https://fr.mathworks.com/matlabcentral/answers/questions. Matlab答案 - 新问题 2021 - 09 - 06 - t13:39:42z 标签:fr.Mathworks.com,2005:问题/ 1447649 2021-09-06T13:05:38Z 2021 - 09 - 06 - t13:39:42z 如何在不使用FITDIST和PDF或任何其他拟合功能的情况下归一化直方图? 我试图为一组标准化的数据创建一个直方图,即箱子或曲线下面积的总和= 1。然而,fitdist或histfit采用的是一种适合,而不是简单地将曲线标准化。附件是两张图片。第一个图像是我需要标准化的直方图,第二个图像是我使用fitdist时的直方图。我需要确保直方图的总面积为1,而不使用拟合函数来操纵实际数据。我如何使数据规范化而不改变/拟合其实际值?x_values = 0:0.01:5;xx_values = 0:0.01:5;data1 =负载(343 e_scx_0p001-deviations.csv);% 343粮食len =长度(data1); limit=len/2+1; StnDev1=reshape(data1(10,3:limit),len/2-1,1); StsDev1=reshape(data1(10,limit+1:end),len/2-1,1); pd = fitdist(StnDev1,'Normal'); y = pdf(pd,x_values); %histogram(StnDev1); plot(x_values,y,'b','LineWidth',2) hold on 雅各布维斯 https://fr.mathworks.com/matlabcentral/profile/authors/12017947 标签:fr.mathworks.com, 2005:问题/ 1447654 2021 - 09 - 06 - t13:38:46z 2021 - 09 - 06 - t13:38:46z 如何将一系列Word文件转换为pdf文件? 它逐个打开Word文件并手动另存为PDF文件很烦人。如何通过Matlab脚本实现Word2PDF功能? 杨董 https://fr.mathworks.com/matlabcentral/profile/authors/23755492 标签:fr.mathworks.com,2005:问题/ 1446109 2021 - 09 - 03 - t13:31:30z 2021-09-06T13:31:54Z 如何使用模拟退火来优化基于仿真的多标准问题? 您好,我尝试优化一个适用的Simulink模型的一些参数。万博1manbetx该模型的结果是3个值(使用能量,经过的时间和成本导致),因此这是一个多标准问题。到目前为止,对于此用例,我使用加权SUMS方法(所有这些标准)与Patternsearch算法结合使用。有2个主要问题结果:1。如何使用模拟退火算法优化多轨道?当我从三个输出函数中形成结构时,SimulanneAlbnd报告错误。2.是否有可能通过约束来判断算法,而不是允许所有值,但是有一定的步长(例如步骤为10 - UB = 100)? 罗宾 https://fr.mathworks.com/matlabcentral/profile/authors/9482161 标签:fr.mathworks.com,2005:问题/ 1446229 2021 - 09 - 03 - t16:44:21z 2021 - 09 - 06 - t13:29:46z 如何写一个特定的数字通过循环 我有一个代码,1)读取两个文件2)计算file1点和fil2点之间的距离3)写一个距离小于2公里的输出。问题是,我想添加到输出文件一个额外的列总结特定数量的每一行代码数据= readcell(“中”)lat1 = cell2mat(数据(4:最后,2))lon1 = cell2mat(数据(4:最后,3))值= cell2mat(数据(4:结束,5))filename1 = ' file2.txt ' % arxeio我makroseismika (d1,特克斯)= importdata (filename1);lat2 = d1.data (:, 2);lon2 = d1.data (: 1);c = d1.data (:, 4);for z=1:numel(stname) distance = (deg2km(distance(lat1(z),lon1(z),lat2,lon2)));%计算距离withinkm =距离<= 2;找到距离小于2公里的行索引。%从所有点集合中只提取那些关闭点。closePointskm = [lat2(withinkm), lon2(withinkm), c(withinkm), distance (withinkm), value(z:numel(withinkm))] writmatrix () end问题在第23行。命令窗口显示:您能帮助我吗? 伊凡密歇根州 https://fr.mathworks.com/matlabcentral/profile/authors/15708342 标签:fr.mathworks.com,2005:问题/ 1447634 2021 - 09 - 06 - t12:44:21z 2021-09-06T13:29:38Z 为什么我没有找到同样的答案? 嗨,我尝试在两种方式计算数学,但我找不到同样的结果,我不知道为什么?。这是问题%方法1a =伽马(3/10)-igamma(3/10,-7 / 100);B = - ( - 1)^(7/10)* 10 ^(3/5);c = a * b;%方法2 alpha = 0.3;s = 0.1;t = 7;a =γ(alpha)-igamma(alpha,-s ^ 2 * t);B = - ( - 1)^(alpha-1)*(1 / s ^ 2)^(alpha);c = a * b; result : why ?? but ! What should i do now ? achbak. https://fr.mathworks.com/matlabcentral/profile/authors/17210878 标签:fr.mathworks.com, 2005:问题/ 894117 2021 - 08年- 07 - t07:14:23z 2021 - 09 - 06 - t13:24:41z 找出最佳的输入组合,使非线性ODE数学模型的输出最大化 如何找到最佳组合的输入(3个输入),将提供最大的输出。请注意,我有一个非线性ODE模型,输出也是微分方程。另外,我有SBML文件,如何进行相同? Darshna Joshi. https://fr.mathworks.com/matlabcentral/profile/authors/19255104 标签:fr.mathworks.com,2005:问题/ 1446459 2021 - 09 - 04 - t07:11:40z 2021-09-06T13:22:55Z 使用带有fsolve的lsqcurvefit 大家好,我试图解决使用fsolve一个非线性方程。的公式为:对于i = 1:长度(t)的溶胶(I)= fsolve(@(X)(参数+ X) - (K5 / X + 2 *(ydata3(I)* K3 * K4。。/(X ^ 2 + X * K3 + K3 * K4))+ ...(ydata3(I)。* X * K3 ./(X ^ 2 + X * K3 + K3 * K4))+ ... 2。*(参数* K1 * K2 ./(X ^ 2 + X * K1 K1 + * K2))+ ...(ydata3(I)。* X * K1。/(X ^ 2 + X * K1 K1 + K2 *。))+ ...(ydata2(I)* K6)./(K6 + X)),X0)。结束然而,参数,帕拉姆,是未知的,我必须配合使用从lsqcurve退步它:参数0 = 0.035;PARAM = lsqcurvefit(@ chargeBal,参数0,T,ydata1);凡YDATA将拥有4×1的大小,而帕拉姆,有一个大小为1×1,我怎样才能使这个工作?完整的代码是:功能pH_Example全球吨pH值K1 K2 K3 K4 K5 K6 ydata1 ydata2 ydata3帕拉姆溶胶pH值= [11.48 6.86 6.72 6.25];T = [0 30 60 100];ydata3 = [2.58E-01 6.28E-02 5.76E-02 4.83E-02];ydata2 = [1.25E-02 9.75E-03 7.93E-03 5.83E-03]; ydata1 = [3.31131E-12 1.38038E-07 1.38038E-07 1.38038E-07]; K1 = 1.09e-6; K2 = 3.69e-10; K3 = 6.2e-4; K4 = 3.11e-8; K5 = 3.02e-14; K6 = (1.91e-2 + 5.38e-4)/2; function H = chargeBal(Param,t) x0 = 10^(-11.48); for i = 1:length(t) sol(i) = fsolve(@(x) (Param + x)-(K5/x + 2.*(ydata3(i).*K3.*K4./(x^2 + x.*K3 + K3.*K4)) +... (ydata3(i).*x.*K3./(x^2 + x.*K3 + K3.*K4))+ ... 2.*(Param.*K1.*K2./(x^2 + x.*K1 + K1.*K2)) +... (ydata3(i).*x.*K1./(x^2 + x.*K1 + K1.*K2))+ ... (ydata2(i).*K6)./(K6 + x)), x0); end function sol = pHfun(t,x) K1 = 1.09e-6; K2 = 3.69e-10; K3 = 6.2e-4; K4 = 3.11e-8; K5 = 3.02e-14; K6 = (1.91e-2 + 5.38e-4)/2; x0 = 10^(-11.48); t = [0 30 60 100]; pH = [11.48 6.86 6.72 6.25]; sol = (Param + x)-(K5./x + 2.*(ydata3.*K3.*K4./(x^2 + x.*K3 + K3.*K4)) +... (ydata3.*x.*K3./(x^2 + x.*K3 + K3.*K4))+ ... 2.*(Param.*K1.*K2./(x^2 + x.*K1 + K1.*K2)) +... (ydata3.*x.*K1./(x^2 + x.*K1 + K1.*K2))+ ... (ydata2.*K6)./(K6 + x)); end H = sol(i); end Param0 = 0.035; Param = lsqcurvefit(@chargeBal,Param0,t,ydata1); fprintf(1,'\tParameters:\n') for k1 = 1:length(Param) fprintf(1, '\t\tParam(%d) = %8.5f\n', k1, Param(k1)) end ph = 3 - log10(sol(i)); plot(t,ph,'r--') hold on plot (t,pH,'kd') xlabel('Time (sec)') ylabel('pH') hold off legend('pH-Mod','pH-Exp') end Dursman Mchabe https://fr.mathworks.com/matlabcentral/profile/authors/21446048 标签:fr.mathworks.com,2005:问题/ 1447529 2021 - 09 - 06 - t10:52:01z 2021-09-06T13:16:02Z 关于将输入作为图像传递给来自两个不同文件夹的函数 功能[差异图] = Map(左视图,RightView)%某些处理步骤将在那时,我需要一次从两个不同文件夹调用两个差异可以在一次暗示如何调用它们示例:假设我有5个图像为左视图 - 单独的文件夹假设我有两个5张来自右视图 - 单独的文件夹,现在我需要一个从右视图一个从右视图写一个循环 Porydy ajaykumar reddy. https://fr.mathworks.com/matlabcentral/profile/authors/21428172 标签:fr.mathworks.com, 2005:问题/ 1447614 2021-09-06T12:33:55Z 2021 - 09 - 06 - t13:09:58z 如何离散非均匀曲线 你好,让我们假设我有以下曲线(见光滑实线),我想离散它们。我知道离散函数,但我想要的是用可变步骤离散它们(见离散模式中的线)。我知道的最简单的方法是手动离散化,把所有的点硬编码和生成模式,但我的主要问题是如果有一个自动化的方式,通过它我可以输入的参考曲线,点的数量和各自的时间,自动创建的曲线。多谢。 Christos Patrinos. https://fr.mathworks.com/matlabcentral/profile/authors/16588639. 标签:fr.mathworks.com, 2005:问题/ 1447644 2021 - 09 - 06 - t04:00:00z 2021 - 09 - 06 - t13:04:41z 在R2020b以后支持的万博1manbetxSimulink Real-Time编译器是什万博1manbetx么? 我的团队正在迁移到Matlab R2020B。在过去,我们需要一个特定版本的Visual Studio,作为根据释放特定的支持编译器使用Simulink实时(SLRT)的编译器页面:https://www.mathworks.万博1manbetxcom/support/requirements/previous万博1manbetx-Release.html但是,对于2020年及以后,我没有看到SLRT支持编译器的文档中的呼叫。万博1manbetxMatlab 2020B的SLRT支持万博1manbetx哪些编译器? MathWorks支万博1manbetx持团队 https://fr.mathworks.com/matlabcentral/profile/authors/4622813 标签:fr.mathworks.com,2005:问题/ 1447589 2021-09-06T12:25:43Z 2021-09-06T12:59:25Z 合并两个保存的数字在一个数字 在那里,我正在努力合并两个将Matlab数字保存到一个数字中。这就是代码的看起来的方式:关闭所有清除所有CLC F1 = OPEN('MATLAB_FIGURE_1.FIG');f2 =打开('matlab_figure_2.fig');我需要有最终数字,其中包含来自f1和f2的数据。感谢您的帮助!最好的事物, Luca de Freitas https://fr.mathworks.com/matlabcentral/profile/authors/9734605 标签:fr.mathworks.com,2005:问题/ 1447629 2021-09-06T12:43:35Z 2021-09-06T12:58:10Z 修改矩阵,使得每个条目可以用四个块写入 您好,我有一个矩阵,说A = [1 2 3 4];我想修改它以这样一种方式,它可写为A = [1 1 2 2 1 1 2 2 3 3 4 4 3 3 4 4];在基质A中的每个条目可以写成四个块。我该如何编写呢? Ahmad Hasnain. https://fr.mathworks.com/matlabcentral/profile/authors/12103865 标签:fr.mathworks.com,2005:问题/ 1447639 2021 - 09 - 06 - t12:55:48z 2021 - 09 - 06 - t12:55:48z 自动打开新文件,因为他们出现在一个文件夹 你好!我目前正在使用ImportData函数从我必须更改的特定文件输入导入数据,每次我有一个新文件。我想知道是否有一个可以自动检测新的.csv文件并在matlab中导入它的函数吗?提前致谢! 艾米莉 https://fr.mathworks.com/matlabcentral/profile/authors/18316520 标签:fr.mathworks.com, 2005:问题/ 1440029 2021-08-24T18:53:05Z 2021-09-06T12:54:21z MRI中的逆快速傅里叶变换 你好,亲爱的MATLB用户,我有一些关于在mri的ifft的问题,如果有人可以帮助我,这将是伟大的。事实是:我想使用ifft从k空间移动到图像空间。我试过应用它,但不幸的是它不起作用。你可以在附件中找到我的kspace的样子。谢谢。威廉 威廉·纳格尔 https://fr.mathworks.com/matlabcentral/profile/authors/18499294 标签:fr.mathworks.com, 2005:问题/ 1447454 2021-09-06T09:11:09Z 2021 - 09 - 06 - t12:53:25z 在MATLAB像imread内置功能构建自定义图像阅读器功能效仿 我是Matlab的初学者,一般编码,我想在matlab中建立一个自定义映像读者函数,而不使用Infort函数,如imread以阅读不同的图像类型(BMP,JPG,PNG等..)可以有人帮助我获得开始这个并将我指出,我需要学习的资源(例如。如何阅读图像的文件指针)感谢您提前帮助! 一个 https://fr.mathworks.com/matlabcentral/profile/authors/23480321 标签:fr.mathworks.com, 2005:问题/ 1445274 2021-09-02T12:18:39Z 2021-09-06T12:44:09Z 在xy平面上绘制CFD导入的3D数据时,Griddata生成重复点 大家好,我有多个从CFD导出的拖拉机预告片的3D快照。我正在对它们进行一些其他数据分析,然后我想可视化这个处理的数据的轮廓。首先,我只是尝试使用x,y,z丁丁丁和速度值直接绘制CFD数据。我主要拥有的问题是:a。轮廓不正确捕获几何边界,形状看起来扭曲。我的x,y,z,u,v和w是列向量。当我在z = 0处制作x.y的网格网格时,我使用griddata命令将我的速度向量重新塑料与n向量相同的n向量作为网格网格。湾当我尝试使用griddata()命令在网格格栅上重塑我的速度向量时,它给出了检测到和平均重复数据点的警告。我认为这是问题区域。 However I tried to use unique() command and it has removed some duplicate points, I dont know how these duplicate points exist in the data. But I am still getting same duplicate data point warning when I use Griddata command. I have attached some matlab pictures of my results and a picture of CFD result which I am expecting to see.Please find the link below of one snapshot of data if someone wants to give a try. DATA below is the code I am using. I use for loop as later I will be using multiple files. clear all; clc; close all; %Read data Files% dataName='saved_data'; % save a file in the directory to keep all data save(dataName); %Save empty file dinfo = dir('*.txt'); %Read directory for all text files files={dinfo.name}; %save names of all text files in files to use in the loop delimiterIn=' '; %How data is seperated headerlinesIn=1; %is there any header n=numel(files); % number of snapshots for j=1:n currentFile=files{1,j}; %load jth snapshot raw_data=importdata(currentFile,delimiterIn,headerlinesIn); %read data in the snapshot %and save it in raw data end %% Raw data%% X=raw_data.data(:,2); Y=raw_data.data(:,3); Z=raw_data.data(:,4); U=raw_data.data(:,11); V=raw_data.data(:,12); W=raw_data.data(:,13); %% Scatter interpolant%% [~, I, ~] = unique([X Y Z],'first','rows'); %here I noticed that there were some duplicate data points which I removed X1 = X(I); Y1 = Y(I); Z1 = Z(I); U1=U(I); V1=V(I); W1=W(I); U2 = scatteredInterpolant(X1, Y1, Z1, U1); %this does not have any duplicate warning now V2 = scatteredInterpolant(X1, Y1, Z1, V1); W2 = scatteredInterpolant(X1, Y1, Z1, W1); spacing=200; x1=(linspace(min(X)/5,max(X)/4,spacing))'; y1=(linspace(min(Y),max(Y)/8,spacing))'; z1=(linspace(min(Z)/4,max(Z)/4,spacing))'; [xmesh, ymesh] = meshgrid(x1,y1,0:0); %% Make velocity grid with U, V and W%% u1=griddata(X1,Y1,U2.Values,xmesh,ymesh); % Again giving duplicate data point warning and removed however the size is still 20 by 200. v1=griddata(X1,Y1,V2.Values,xmesh,ymesh); w1=griddata(X1,Y1,W2.Values,xmesh,ymesh); res_vel=sqrt(u1.^2+v1.^2+w1.^2); %% Contourf Plot U,V data%% h_fig1 = figure(1); contourf(xmesh,ymesh,res_vel,0.0001:20) colorbar() caxis([-1, 27]); To summarise, Any suggestion how to avoid duplicate data point warning while solving griddata command. Or any alternate to grid data? secondly, if the problem is not with the grid data then any way of improving the quality of boundary captured and results. I noticed the velocity in the surrounding area is high but contour is showing small value. I really appriciate any help as I am stuck here for long time. Thanks 默罕默德爱 https://fr.mathworks.com/matlabcentral/profile/authors/23441201 标签:fr.mathworks.com, 2005:问题/ 1447609 2021 - 09 - 06 - t12:33:23z 2021 - 09 - 06 - t12:43:54z 位置2的索引超过数组边界(不能超过1)? 我的代码是:函数hout = hcomb(a,b,c)%%%%%获取图像的大小[r,c] =大小(a);对于i = 1:r for j = 1:c if(a(i,j)> b(i,j))&&(a(i,j)> c(i,j))hout(i,j)= a(i,j);elseff(b(i,j)> a(i,j))&&(b(i,j)> c(i,j))hout(i,j)= b(i,j);elseff(c(i,j)> a(i,j))&&(c(i,j)> b(i,j))hout(i,j)= c(i,j);结束结束返回; 您正在R https://fr.mathworks.com/matlabcentral/profile/authors/15481556 标签:fr.mathworks.com, 2005:问题/ 439069 2019 - 01 - 10 - t02:06:37z 2021 - 09 - 06 - t12:43:25z 如何在matlab中打开。p文件? 我有一个文件的扩展名。img是大约70MB和一个。p文件查看他们,我需要使用matlab打开/查看图像。请帮帮我 Sindhura C. https://fr.mathworks.com/matlabcentral/profile/authors/13299548 标签:fr.mathworks.com, 2005:问题/ 1447594 2021-09-06T12:26:59Z 2021-09-06T12:40:58Z 运算符的使用无效。 对于II = 2:26对于JJ = 1:26对于II〜= JJ A(II,JJ)= [A(II,JJ)+ ELREM(II)+(II)];结束结束结束为什么它会给第3行的“操作员无效? 丽贝卡·D 'Onofrio https://fr.mathworks.com/matlabcentral/profile/authors/21645196 标签:fr.mathworks.com, 2005:问题/ 1447624 2021-09-06T12:39:44Z 2021-09-06T12:39:44Z ODE113中提前退出而不是警告? 在运行使用ODE113的代码时,程序将在手动暂停之前运行,可能无限期地运行。暂停后,出现错误“无法达到集成公差而不降低允许的最小值的步长”。有没有办法告诉ODE113以生成错误而不是警告(或其他东西停止代码),因此程序不会卡在徒劳力计算中? 诺姆Ouzana https://fr.mathworks.com/matlabcentral/profile/authors/17855209. 标签:fr.mathworks.com,2005:问题/ 1447584 2021-09-06T12:15:05Z 2021 - 09 - 06 - t12:37:02z 我想计算多少时间,我的代码模拟。应该考虑代码中的哪些更改 关闭所有CLC%输入参数NX = 10;%网格点数ny = nx;x = linspace(0,1,nx);y = linspace(0,1,ny);dx = x(2)-x(1);dy = dx;%误差标准错误= 1;耐受= 1E-6;%定义边界条件T_L = 100;t_t = 400; T_R=300; T_B=200; T=300*ones(nx,ny); T(2:ny-1,1)=T_L; T(2:ny-1,nx)=T_R; T(1,2:nx-1)=T_T; T(ny,2:nx-1)=T_B; %Calcualting Average temp at corners T(1,1)=(T_T+T_L)/2; T(nx,ny)=(T_R+T_B)/2; T(1,ny)=(T_T+T_R)/2; T(nx,1)=(T_L+T_B)/2; %Assigning Orginal Values to T T_initial=T; T_old=T; % Jacobi method iterative_solver=1; if iterative_solver==1 jacobi_iteration=1; while(error>tolerance) for i=2:nx-1 for j=2:ny-1 T(i,j)=0.25*(T_old(i-1,j)+T_old(i+1,j)+T_old(i,j+1)+T_old(i,j-1)); end end error=max(max(abs(T_old-T))); T_old=T; jacobi_iteration=jacobi_iteration+1; end end %plotting graphs figure() contourf(x,y,T) clabel(contourf(x,y,T)) colorbar colormap(jet) set(gca,'ydir','reverse') xlabel("X Axis") ylabel("Y Axis") title(sprintf("No of Jacobi iterations(Implicit)=%d", jacobi_iteration)); 顾磊杰(Rajat Powade https://fr.mathworks.com/matlabcentral/profile/authors/22897839 标签:fr.mathworks.com, 2005:问题/ 1447619 2021-09-06T12:36:15z 2021-09-06T12:36:15z 简化的微电网模型中指定的SoC在哪里 在该示例文件//www.tianjin-qmedu.com/help/physmod/sps/ug/simplified-model-of-a-small-scale-micro-grid.html所述电池的SOC开始于80%,其中是该模型中的初始SOC集。请指教 神经网络 https://fr.mathworks.com/matlabcentral/profile/authors/15064601 标签:fr.mathworks.com, 2005:问题/ 1446934 2021-09-05T05:37:09Z 2021-09-06T12:35:40Z 在一个脚本中有多个图形 大家好,我想在一个脚本中绘制几个图。但是,它总是给出最后一个图。%% 6 x = ([-2*pi:0.1:2*pi]);f = x-sin g = 1 - x (x)。* cos (x)情节(x, f, x, g)标题(f (x) & g (x)”)次要情节(1、2、1)情节(x, f)标题(f (x))次要情节(1、2、2)情节(x, g)标题(“g (x)”)是错误的 巴西姆almutairi https://fr.mathworks.com/matlabcentral/profile/authors/23649900 标签:fr.mathworks.com,2005:问题/ 1447559 2021-09-06T11:41:47z 2021 - 09 - 06 - t12:33:43z 求矩阵中浮点数的索引 查找方法允许我们在矩阵/阵列中返回特定元素的indice。但是,当矩阵包含浮点值时,查找通常返回空数组。我通过添加公差来使用以下算法,但即使是失败。所以现在2个问题为什么发现浮点阵列上的发现失败,其次是如何解决问题Idx = find(abs(x-2.5)<1e​​-3);x如下所示 蜘蛛侠 https://fr.mathworks.com/matlabcentral/profile/authors/2122425 标签:fr.mathworks.com, 2005:问题/ 1447599 2021 - 09 - 06 - t12:27:45z 2021 - 09 - 06 - t12:31:43z 错误索引超过数组元素数量(0) 大家好,我的代码似乎有一个问题,但我不能克服它。我收到了刺激信号。通过findpeak我找到了一个参考点。我的目标是从参考点开始检查,向后5个点,这是我的信号低于某个treshould(0.5)的第一个点。%找到刺激峰大于2mA %码检测第一个峰locp = loc(1);k = 1;如果abs(loc(I)-loc(I -1))>6 k = k+1,则只保留与下一个峰有距离的第一个峰>6个样本;locp (k) = loc(我);从峰值开始,向后5个样本,找到峰值前的第一个样本小于阈值=0.5 ma ind1=locp(i):-1:locp(i)-5;段= stimp (ind1); ind= find(segment<0.5); lock(i) = ind1(ind(1)); end I don't understand because sometimes is working, some other times no the error is: Index exceeds the number of array elements (0). Error in Untitled (line 9) lock(i) = ind1(ind(1)); Please find attached a copy of the stimulation signal= stimp Can anyone help me with this? Thanks a lot for your time Regards, Francesco Francesco Lucarelli. https://fr.mathworks.com/matlabcentral/profile/authors/21023628 标签:fr.mathworks.com, 2005:问题/ 1447604 2021-09-06T12:29:27Z 2021-09-06T12:29:27Z 无误差的傅里叶反变换问题 我有一个matlab代码,我需要执行逆傅里叶变换,但它不会产生任何输出。看来跳过频域中的一些数据点,也许这可能是Matlab无法对时域执行逆傅里叶变换的原因。请有人帮助我解决这个问题。请求在代码下方找到。提前感谢您的回复。清除所有;关闭所有; CLC%的目的本准则;给定THz脉冲的单次拍摄表征,通过使用啁啾脉冲来表征THz脉冲n = 1024 * 2 ^ 14;dt = 1e-14;t =(0:n / 2-1)* dt;df = 1 /(n * dt); f=(0:N/2-1)*df;w=2*pi*f; d = 500e-6; m=(289.27-(6*(f*1e-12).^2))./(29.16-((f*1e-12).^2)); q=real(sqrt(m));%phase index of THz radiation s=3.2394;c=3e8; T=0.15e-12; first_term=exp(-(w).^2*T.^2/4).*(sqrt(2)*pi*T./(q.^2 - s^2)); second_term=0.5.*(1+ (s./q)).*(exp(i.*w.*q*d./c)); third_term=(0.5*(1- (s./q)).*exp(-i.*w.*q.*d./c)); fourth_term=exp(i.*w.*s.*d./c); result= first_term.*(second_term + third_term - fourth_term); RESULT=abs(result).^2; figure(1);plot(f,RESULT);title('frequency plot') figure(2);plot(t, ifft(RESULT));title('time plot') 摩西Eshovo处 https://fr.mathworks.com/matlabcentral/profile/authors/17802732 标签:fr.mathworks.com, 2005:问题/ 1447524 2021 - 09 - 06 - t10:50:30z 2021 - 09 - 06 - t12:27:29z 为什么会收到“试图一起成长暧昧维数组”,试图在灰度图像应用二进制掩码是什么时候? 我正在研究一个粒子检测项目,我正在使用Hough方法来检测粒子(在灰度背景上的白色环)。一旦检测到粒子,我想裁剪并在其上施加黑色圆形掩模,以便排除来自我的数据集的重叠粒子。(如果检测到的粒子与另一颗粒重叠,则掩蔽区域之外的强度高于我的阈值,并且图像被拒绝)。该代码适用于大约70-100次迭代,并且在此之后获得以下错误消息:尝试沿着模糊的维度增长数组。f1_save_pi_m2(第31行)greyscale(circlemask)= 0错误。这是代码:i = 1:长度(xa)d = da(i);if(d> 0)%%切割颗粒图像引脚=引脚+1;粒子图像数OL = 63的%运行变量;粒子中心LB = MAX周围的%轮廓(YA(i)-OL,1);rb = min(ya(i)+ + 1,尺寸(a,1)); bb = max(xA(i)-ol,1); ub = min(xA(i)+ol+1,size(A,2)); partIm = A(lb:rb, bb:ub); %stiff image size definition %% Reject Overlaps, random noise by masking image % Create circular mask imageSizeX = 128; imageSizeY = 128; cX = 63; cY = 63; R = D/2 + ovl; [columns rows] = meshgrid(1:imageSizeX, 1:imageSizeY); circleMask = (rows - cY).^2 + (columns - cX).^2 <= R.^2; greyscale=partIm; greyscale(circleMask) = 0; radoslav yankov https://fr.mathworks.com/matlabcentral/profile/authors/17807737 标签:fr.Mathworks.com,2005:问题/ 523556 2020-05-06T19:48:04z 2021 - 09 - 06 - t12:26:00z 是否可以将“网格上”带到图的前面? 亲爱的,通常是当我在我的身材后面看出来的网格时,但我需要把它带到我的身上。是否可以?我搜索了,发现了一个代码,将网格刻录到图像中,但这里我有一个数字。这是我的图:这个总结的代码来生成它:s = shaperead('country_boundary.sh');lon = s.x;Lat = s.y;绘图(LOW,LAT,'-K')网格上(GCA,'YTICK',(24:.5:44))设置(GCA,'XTICK',(44:.5:64))谢谢有什么建议。 Behzad Navidi. https://fr.mathworks.com/matlabcentral/profile/authors/15525777 标签:fr.mathworks.com, 2005:问题/ 150830 2014 - 08 - 14 - t14:16:04z 2021 - 09 - 06 - t12:21:39z ementflow的XML架构 我希望能够检查XML文件是否有效状态流。我在哪里可以找到一些XML架构? Pavla https://fr.mathworks.com/matlabcentral/profile/authors/4789680 标签:fr.mathworks.com, 2005:问题/ 1447579 2021 - 09 - 06 - t12:12:48z 2021 - 09 - 06 - t12:15:51z 如何求解耦合的二阶2因式1自变量方程? 我是Matlab的新手,并希望解决以下等式(在图像中)。这里C1和CK是变量Z的功能。V1,D1,VK,DK,K,KD和C_CMC是所有常数。边界条件是 - > C1(0)= 0,C1(0.1)= 0.025,CK(0)= 0.125,CK(0.1)= 0如何解决该等式?请帮忙。即使使用其他常量值,我如何解决这种类型的方程式?V1 = 2.03 * 10 ^ -14;VK = 1.3 * 10 ^ -12;d1 = 9.8 * 10 ^ -10;DK = 1.2 * 10 ^ -10; k=3; Kd=10^5; c_cmc=8.3334; I=imread('eqn.png'); imshow(I) Atharva骡 https://fr.mathworks.com/matlabcentral/profile/authors/17140619 标签:fr.mathworks.com,2005:问题/ 1447499 2021 - 09 - 06 - t10:05:23z 2021-09-06T12:13:36Z 如何形成一个函数使用'for loop'没有'sym'命令 我试过m = 150;《超能= 40;奈= 0;for i=1:2:m nAi = @(phi)nAi+cos(i*phi);end nA = vpa((nAi+Aos), 4)我得到这个错误操作符'+'不支持类型为'function_handle'。万博1manbetxError in ll (line 8) nA = vpa(nAi+Aos, 4) 芭芭拉特哈 https://fr.mathworks.com/matlabcentral/profile/authors/19988784 标签:fr.mathworks.com, 2005:问题/ 1447574 2021 - 09 - 06 - t12:11:53z 2021 - 09 - 06 - t12:11:53z Spl_meter函数输出值差 嗨,我想要1/3 octrave乐队db所以我使用spl_meter函数,但我将相同的值放入相同的函数中,但出现的值是不同的。我想知道这个ature的原因 新疆哈密市JE https://fr.mathworks.com/matlabcentral/profile/authors/17191616 标签:fr.mathworks.com,2005:问题/ 1447549 2021 - 09 - 06 - t11:22:52z 2021-09-06T12:08:14Z 如何查看MATLAB Live工作区数据的权重 大家好!我有一个很大的MATLAB Live字段,在其中我保存了许多工作空间数据。我希望假设有一个命令可以获取总的工作空间数据的权重。MATLAB生活的原因是因为在我运行这个脚本,comand操作运行缓慢,,我认为重要的是要知道,有时当工作区是非常完整的在这种情况下,当我修改脚本有时不能得救,最后的几个变化也没有保存。非常感谢! JosepLlobetLladó. https://fr.mathworks.com/matlabcentral/profile/authors/22817879 标签:fr.mathworks.com, 2005:问题/ 1447474 2021 - 09 - 06 - t09:43:11z 2021 - 09 - 06 - t12:07:45z 多个号码中的字符串转换成矩阵 你好,我正在尝试将一个软件的输出日志转换成一个随时可用的矩阵。该软件的输出是一个txt文件,其中包含如下字符串的系列:[[-0.4888 -0.4661 -0.7374 54.5679][-0.4835 0.8483 -0.2157 25.8953][0.7262 0.2511 -0.64 58.3138][0。0.0.1.[]]我试图读取这些字符串和提取数字,以获得以下格式AKA一个正常的matlab矩阵双精度:[-0.4888 -0.4661 -0.7374 54.5679;-0.4835 0.8483 -0.2157 25.8953;0.7262 0.2511 0.64 58.3138;0 0 0 1];我已经能够阅读txt文件,但我不明白如何提取所有的数字,并把它放在一个正常的矩阵。 Thanks for your help! Giacomo Giacomo Bertazzoli https://fr.mathworks.com/matlabcentral/profile/authors/8869864 标签:fr.mathworks.com,2005:问题/ 1447569 2021-09-06T12:06:42z 2021-09-06T12:06:42z 如何设置训练数据,以便每次只向神经网络输入一组数据(行为曲线)? 我正在研究一个路径依赖神经网络,以预测给定一组参数的应力应变行为。输入值和输出值如下:输入值:混凝土强度、屈服强度、钢筋比、…应变(800预定义的步骤在一个统一的增量)输出:压力训练数据是这样的(行:L行M的预测变量和响应变量):对于每一个标本,我有801行数据(800预定义的应变措施),这是一个应力应变曲线,所以数据是路径依赖。我有100个标本供训练。我的问题是,如何将一个样本(801行)的数据作为一个批处理,每次将一条曲线(一个样本)输入神经网络,并重复(优化)直到100个样本被输入?我想数据必须按顺序输入,因为它与路径相关。我试着写一个for循环,它看起来像下面,但它会覆盖偏差和权重每次。换句话说,最后,权重和偏差只使用最后一个样本数据(一个样本)进行训练。for b = 2:100 inputs = predVar(1:801,:);目标= resVar (1:801, 1); nn = train(net,inputs',targets'); inputs = predVar(801*(b-1):801*b,:); targets = resVar(801*(b-1):801*b,1); nn = train(net,inputs',targets'); end The neural network that I developed is a feedforward neural network. In the prediction stage, a loop also created to predict the stress at each predefined strain steps. I have been searching for the answer for the past three weeks but no luck. Any suggestion and advice is welcome. Thank you for reading this. Stay safe and healthy! Hiew绮 https://fr.mathworks.com/matlabcentral/profile/authors/23459051 标签:fr.mathworks.com, 2005:问题/ 1443109 2021 - 08 - 30 - t07:09:11z 2021-09-06T12:03:35Z 从一个向量中选择0到1之间唯一的随机数。 你好,我正在尝试从一个获得的向量生成0到1之间的唯一随机数。我正在使用“randsample”函数从向量“y”生成所需的随机数。这个向量“y”是一个累积分布函数(CDF),由不同概率分布函数(PDF)的手工求和得到。它包含大量的0和0.75。当我尝试使用“randsample”生成随机数时,这两个数字会重复它们自己。我运行这个程序多次(数千次)。但至少一次,我需要唯一的号码。你能建议在这个问题上产生唯一随机数的方法吗?pos = randsample (y, 4); 罗希特Mangalekar https://fr.mathworks.com/matlabcentral/profile/authors/17966861. 标签:fr.mathworks.com, 2005:问题/ 1446769 2021-09-04T19:08:09Z 2021 - 09 - 06 - t11:56:59z 我必须安装,以便安装Perl的Matlab的? 我正在安装Matlab 2020b,我有一个名为“perl”文件夹的问题。也许我需要安装它… 弗拉基米尔•Boluarte Pretell https://fr.mathworks.com/matlabcentral/profile/authors/8946529. 标签:fr.mathworks.com,2005:问题/ 1447564 2021-09-06T11:48:43Z 2021 - 09 - 06 - t11:55:54z 有些方法可以在轴标签中用变形物写字母吗? 嗨,我正在捷克语写下我的学士学位论文。我正在使用matlab来制作数字和图表。我必须在轴标签中具有横轴标签的字母,但每次时,当我使用这样的东西时(f。č),在图中只出现'''。请,有些脚本,我可以下载哪个脚本,这将解决这个问题?我必须使用MS Visio编辑我的图表,并且它非常浪费。谢谢你的回答。 ondrej burkot. https://fr.mathworks.com/matlabcentral/profile/authors/21807425 标签:fr.mathworks.com, 2005:问题/ 1438404 2021 - 08 - 22 - t07:32:05z 2021 - 09 - 06 - t11:52:28z 使用LabelVolshow时可以手动更改NumLabels吗? 你好,我在自定义函数中使用了labelvolshow来显示3D时间序列数据,但是遇到了关于colormap的问题。我的数据是这些大小V = 483x496x5双;多个相同的大小和class Ln = 483x496x5 uint16;L中的值是根据出现时间给出的,这使得我的总数numLabels超过2000个,但只有一些在同一个L中(例如:文档说LabelColor接受numLabels-by-3,其中numLabels表示标签卷中的标签数量,但我仍然给它一个尝试cmap = colormap(jet(numLabels));hImage = labelvolshow (L, V,‘父’,P1,…写成BackgroundColor,写成BackgroundColor, ScaleFactors, scalefact,……'VolumeOpacity', vol透明度,'VolumeThreshold', volthreshold, 'LabelColor',cmap);as expected, I got error message: error using labelvolshow expected LabelColor to be of size 8x3, but it is of size 2806x3。所以我想知道对于我的目的有什么建议/解决方案吗? 吴有为 https://fr.mathworks.com/matlabcentral/profile/authors/17329446 标签:fr.mathworks.com,2005:问题/ 1446464 2021-09-04T07:22:17Z 2021-09-06T11:49:48Z 3*3的子矩阵有不同的维数。如何从这些子矩阵形成3*3矩阵? J1 = 54.2800 -33.2800 -33.2800 66.0400 >> J2 J2 = 24.8600 -16.6400 >> J3 J3 = -27.1400 16.6400 >> J4 J4 = 49.7200 J = [J1 J2 J3 J4] Prashant Sharma. https://fr.mathworks.com/matlabcentral/profile/authors/23435825 标签:fr.mathworks.com,2005:问题/ 1447399 2021 - 09 - 06 - t07:44:40z 2021-09-06T11:49:27Z 如何沿指定方向计算3D凸壳的投影区域? 我有一个NX3数组点,它代表了一个凸船,我正在使用MateTom,特别是GEOM2D和GEOM3D,用于评估船体的3D定向边界框:BOX = OrientedBox3D(HULL);船体是NX3阵列和盒子是1x9输出,给出:3个坐标的边界框的3个尺寸,相对于方向中心=框(1:3);尺寸=框(4:6);角度=盒子(7:9);我需要评估凸壳的投影区域,垂直于边界框的最小尺寸。我的想法是将欧拉角转换成旋转矩阵,并使用其转换旋转凸壳。rotmat = euleranglestorotatoration3d(角度);CEDREDHULL =赫尔 - 中心;RotatedHull = TransformPoint3d(Centredhull,Rotmat');然后,我可以忽略旋转的Hull中的一组点的z坐标,并计算多边形区域:ProjectedArea = Polyarea(旋转的大(:,1),旋转大(:,2)); The main problem I have is that I am not sure my method is correct and I have no real way to test it. For this reason I'm asking you: how would you solve this problem? Eduardo Maria Polli. https://fr.mathworks.com/matlabcentral/profile/authors/14314427 标签:fr.mathworks.com, 2005:问题/ 1447419 2021-09-06T08:08:24Z 2021-09-06T11:49:13Z SIM命令未打开Simulink模型,但工作区显万博1manbetx示输出变量ANS?! 我试着做的是从运行MATLAB脚本Simulink的文件,这样就不万博1manbetx必seperately打开它。我的S万博1manbetximulink模型从MATLAB的工作空间取值。所以我缩进要做的就是运行它把变量与值到工作区中的maltab,然后运行(模拟)只从MATLAB脚本Simulink模型。万博1manbetx我使用的SIM卡的命令,但它似乎并没有工作(不运行Simulink模型)的做法,但有这个ANS变量,显示了在workapsace地区,万博1manbetx是对我没有用的。I'ven't使用的任何“为工作区”块要么。 苏拉辛格 https://fr.mathworks.com/matlabcentral/profile/authors/11683066 标签:fr.mathworks.com, 2005:问题/ 1446059 2021-09-03T12:51:34Z 2021-09-06T11:47:56Z 为什么我用这个MATLAB代码得到错误的输出? 亲爱的各位,我们有信号数据和脚本来提取满足2个标准(信号强度+持续时间)和指定的各种情况(例如,信号超过阈值一次,两次,>2x…)的第一个数据点。1个数据点= 10ms。我们的输出是'mro',它应该打印ms中的第一个数据点,满足2个标准;如不符合上述两项条件,应使用“nan”列印。bcdata = DATA{TrialInd} - mean(DATA{TrialInd}(50:100));% SD计算基线期SDbl = std(bcdata(50:100));%阈值定义,设为基线阈值的5SD = 5*SDbl;% threshold必须超过至少850ms thresholdLength = 85;Mrosearch = find(bcdata(115:400) >threshold);diffmrosearch = diff (mrosearch); breaks = find(diffmrosearch~=1); partind=1; plot(bcdata,'bO'); axis tight hold on %if signal is more than once over threshold if ~isempty(breaks) part{partind} = (mrosearch(1)-1):mrosearch(breaks(1)); partlength(partind)=length(part{partind}); plot(part{partind}+115, bcdata(part{partind}+115), 'rO'); partind=partind+1; %this part is if there are >2 times over threshold for breakind=1:length(breaks)-1 part{partind} = mrosearch(breaks(breakind)+1:((breaks(breakind+1)-1)-1)); partlength(partind)=length(part{partind}); plot(part{partind}+114, bcdata(part{partind}+114), 'yO'); partind=partind+1; end breakind=length(breaks); part{partind} = mrosearch(breaks(breakind)+1:(end-1)); partlength(partind)=length(part{partind}); plot(part{partind}+114, bcdata(part{partind}+114), 'mO'); firstgt5 = find(partlength >thresholdLength, 1); if isempty(firstgt5) mro = NaN; else onsetDatapoint = part{firstgt5}(1)-1; mro = onsetDatapoint*10+150; end % if signal is exactly once over threshold elseif isempty(breaks) & ~isempty(mrosearch) onsetDatapoint = mrosearch(1)-1; mro = onsetDatapoint*10+150; plot(mrosearch+114, bcdata(mrosearch+114), 'gO'); % if signal never exceeds threshold else isempty(breaks) & isempty(mrosearch) onsetDatapoint = NaN; mro = NaN; end We seem to have 2 errors: 1) Case: signal exceed threshold once (last section in script) -> 'mro' output is incorrect when the duration criterion is not met. Can be seen in plot of the signal (g0). Output should be 'nan' but numeric output is provided: 2) Case: signal exceed threshold twice -> 'mro' output is incorrect when the duration criterion is not met. Can be seen in plot of the signal (m0). Output should be 'nan' but numeric output is provided: -> 'mro' output is incorrect when the threshold is exceeded twice and first time criterion is met. Output should be numeric but a wrong data point is selected. Can be seen in plot of the signal (r0): Does someone know how to adapt the script above to get the desired outputs? I would be very grateful for your help and thanks in advance! https://fr.mathworks.com/matlabcentral/profile/authors/9219864 标签:fr.mathworks.com,2005:问题/ 1447344 2021 - 09 - 06 - t06:18:25z 2021-09-06T11:45:32Z 分布拟合曲线下的面积 我使用统计学和机器学习来帮助我创建一个适合我的数据。然而,我现在需要找到拟合曲线下的面积,我不能使用trapz(X,Y),因为我没有任何变量,我的数据是261345x1数据集。请建议! 见凯翔 https://fr.mathworks.com/matlabcentral/profile/authors/13292894 标签:FR.Mathworks.com,2005:问题/ 358060 2017-09-23T21:15:03z 2021 - 09 - 06 - t11:41:37z 我需要使用遗传算法的wsn的matlab代码 我需要MATLAB GA模拟WSN Louisa Ogusha. https://fr.mathworks.com/matlabcentral/profile/authors/10701762 标签:fr.mathworks.com,2005:问题/ 358061 2017-09-23T21:16:26Z 2021 - 09 - 06 - t11:39:52z 我需要MATLAB代码使用遗传算法将WSN放置 我需要GA仿真用于放置传感器节点的无线网络中的MATLAB代码(即使用MATLAB中的GA优化工具)。至于regatds最大化网络寿命,连接性,覆盖范围,同时尽量减少能源消耗 Louisa Ogusha. https://fr.mathworks.com/matlabcentral/profile/authors/10701762 标签:fr.mathworks.com,2005:问题/ 1445899 2021 - 09 - 03 - t08:27:48z 2021-09-06T11:29:22Z 通过添加不同类型的PDF,生成随机数,形成一个CDF 你好,我在MATLAB中读过一些关于生成随机数和开发分布函数的线程。我无法得到我的疑问的答案,也猜我还不知道MATLAB的所有功能和能力。我正在尝试从多个pdf(不同的变量)开发一个CDF。我能做到。但是接下来的部分——从这个自定义CDF生成随机数是非常棘手的,而且会造成麻烦。你能告诉我-如果我能知道这个自定义CDF的分布类型(如果可能,不使用分布钳子工具箱-因为这是在程序的中间,运行多次)?我想把这个CDF匹配到合适的PDF,然后从那个PDF生成随机数。请指导。(如果我遗漏了什么,请告诉我。)提前感谢您的宝贵时间。 罗希特Mangalekar https://fr.mathworks.com/matlabcentral/profile/authors/17966861. 标签:fr.mathworks.com, 2005:问题/ 655163 2020 - 11 - 20 - t23:38:07z 2021 - 09 - 06 - t11:25:18z 人工神经网络预测属性值的应用程序? 嗨,所有人,对于学校项目,我正在寻找创造一个人工神经网络(深度学习)来预测财产价值(房地产价值)。我有大约40,000个属性(年龄,大小,条件,位置等)的数据及其当前值。我知道人工神经网络已被用于财产估价。Matlab使用的最佳应用是什么?我在Matlab在Matlab中找到的大部分内容识别图像识别。任何帮助将不胜感激。谢谢,亚历克斯 Alex Hynd. https://fr.mathworks.com/matlabcentral/profile/authors/20384735 标签:fr.mathworks.com, 2005:问题/ 1447544 2021-09-06T11:21:52Z 2021-09-06T11:21:52Z RPN在更快的R-CNN是如何工作的? 我想知道RequirateProposal层如何输出正确(x,y,w,h)。RPNBoxDeltas层培训以输出正确的(DX,Dy,DW,DH)。RPNClassification也受过培训,以输出正确的对象或背景分类程度。如果有人回答我的问题,我很欣赏它。谢谢你。 Shigeru Kato. https://fr.mathworks.com/matlabcentral/profile/authors/8428340 标签:fr.mathworks.com, 2005:问题/ 1447534 2021 - 09 - 06 - t10:52:18z 2021 - 09 - 06 - t11:18:31z 如何通过图像处理来确定钻孔的表面粗糙度。我知道读取图像和转换成灰度图像,请帮助我进一步的进展 如何通过图像处理来确定钻孔的表面粗糙度。我知道读取图像和转换成灰度图像,请帮助我进一步的进展 尼克尔科特尼亚 https://fr.mathworks.com/matlabcentral/profile/authors/23678257