//www.tatmou.com/matlabcentral/answers/questions MATLAB答案-新问题 2020 - 03 - 16 - t15:18:03z 标签:www.tatmou.com,2005:问题/ 510562 2020-03-12t15:37:10z 2020 - 03 - 16 - t15:18:03z 如何在视频中使用图像背景减法 我想要在视频中减法。问题是某些视频的第一帧不是空的。我的意思是,第一帧视频中有一个人。因此,当我使用背景减法时,结果不像图片一样好。你有一个好主意吗?我认为我可以使用背景图像。我正在使用这个dataSet http://www.wisdom.weizmann.ac.il/~vision/spacetimeaiptions.html(弯曲数据集)我想获得这种结果。(数据集是不同的)(侧数据集)清除全部关闭全部%//读取视频:reader = Videoreader('shahar_bend.avi');vid = {};Hasfame(读者)vid {end + 1} = IM2single(ReadFrame(Reader)); end %// simple background estimation using mean: bg = mean( cat(4, vid{:}), 4); %// estimate foreground as deviation from estimated background: fIdx = 40; %// do it for frame 43 fg1 = sum( abs( vid{fIdx} - bg ), 3 ) > 0.25; fg2 = imresize(fg1, 0.5); figure; subplot(141); imshow( bg ); subplot(142); imshow( vid{fIdx} ); subplot(143); imshow( fg2 ); https://www.mathwands.com/matlabcentral/profile/authors/14262556-kong. 标签:www.tatmou.com, 2005:问题/ 511139 2020-03-16T15:17:57Z 2020-03-16T15:17:57Z 可以分阶段。对象逐帧运行? 对于这些波束形成器对象,示例始终显示完全波形和完全波形OUT。在我的应用程序中,它在数据的帧上运行,在进入时处理它。Matlab建议其对象跟踪所有状态和初始化。所以我的问题是,每次运行它们时,都会进行这些波束形成器对象init,即处理一帧(或在示例中的整个波形的开头)?是否有一个机制来输出状态并携带到诸如过滤器功能之类的下一个帧?另外,对于GSCBeamFormer对象,是否有一个原因权重不作为选项?如果用户可以访问帧之间的权重和过滤状态,则会很好,以便检查实现并更好地理解波束形成机制。如果我错过了什么,请告诉我谢谢! TJ垫块 //www.tatmou.com/matlabcentral/profile/authors/3756217-tj-plummer 标签:www.tatmou.com, 2005:问题/ 511034 2020-03-16T02:53:08z 2020 - 03 - 16 - t15:17:20z 计算CSV文件中的数据数 您好MATLAB社区temps是一串数字,范围从20到70在一列。所以我努力想要做的是,我想要把小于32的数据点的数量加起来(只是数据点的数量,而不是实际数据的数量,这些数字的范围是20到70,加起来)。下面是我的代码,我不知道如何继续。临时工=负载(' 40819 decjanlancastertemp.csv ');plot(temps) xlabel('Dec2018 Jan2018 ') ylabel('Temperature (F)') title('时温')for i = 1:length(temps) if temps(i) <= 32 elseif temps(i) > 32 end end Ireedui Ganzorig //www.tatmou.com/matlabcentral/profile/authors/17301705-ireedui-ganzorig 标签:www.tatmou.com, 2005:问题/ 511116 2020-03-16T12:54:12Z 2020-03-16T15:15:53z 用某个阈值对矩阵进行二值化 嗨,Matlab专家,如何根据一定的阈值对矩阵进行二值化?例如,最高的400个值还是最高的20%的值?谢谢!塔米尔 艾森斯坦米尔 //www.tatmou.com/matlabcentral/profile/authors/10114247-tamir-eisenstein 标签:www.tatmou.com, 2005:问题/ 510644 2020-03-13T02:57:07z 2020 - 03 - 16 - t15:13:20z 如何将特定频率放在频域中的特定箱中? 我有八个音调是由f,我想每两个音调之间的距离如图不同,频率间隔,但我需要把语调正确,我需要解决和样本的数量是适合FFT的考虑。N = 8;r = 1;f_d = 1 e3;M = 4;m = 0: m - 1;fc = 2.45 e9;% %频率间隔为j = 1: M f_spac (j) = M (j) * (1 + r) * f_d;生成i=1:M的频率向量f(:,i)=[fc+((1+ M (i)*r)/2)*f_d;fc - ((1 + m (i) * r) / 2) * f_d]; end B = reshape(f,[1,N]); fs=20*f(N/2); % Sampling frequency Ts=1/fs; % Sampling time t=0:Ts:1e3*Ts; % Time vector 卡西姆穆罕默德 //www.tatmou.com/matlabcentral/profile/authors/16117868-qasim-mohammed 标签:www.tatmou.com, 2005:问题/ 510746 2020 - 03 - 13 - t17:11:12z 2020 - 03 - 16 - t15:11:39z 从与中心线相切的矩阵中提取点 你好,我有一个有两个分支的管(请参阅所附的点云,显示这个模型,其中列分别是x、y、z和一个变量)。我还有一条贯穿模型主要分支的中心线。也请参阅所附的中心线点,其中各列分别为x y z。我还附上了显示模型和中心线的图片。在模型几何上绘制的红色轮廓突出了主分支所在的位置。在每个中心线点上,我试图提取沿模型到中心线点的切线位置的点到一个新的矩阵,以及它们相应的变量值。我已经附上了两张图片,希望能更好地阐明我想要实现的目标。我是相当新的Matlab,所以深入的解释将是伟大的。提前谢谢。 乙肝 //www.tatmou.com/matlabcentral/profile/authors/5716959-hb. 标签:www.tatmou.com, 2005:问题/ 510710 2020 - 03 - 13 - t13:20:17z 2020 - 03 - 16 - t15:10:24z 斜率恒定的直线与斜率变化的直线的交点 你好,我有两条不同的线代表不同的河流轮廓。海平面以上的绿线(见本文底部的jpg)代表现代河道,而黄线代表过去的河道。我想找出两条线的交点。代码也必须是相当普遍的,因为我将应用到不同的河流配置文件,而不仅仅是这个特定的。下面是关于代码的具体信息:% call upon river profile #2980 out of 10848 channel_height=0:20;channel_length = channel_len (idx:);% channel_len from dataset plot(channel_length,channel_height), % plot the upslope channel profile (green line) hold on, plot(-1000*shelf_len(idx,1:7),0:-20:-120), % plot the shelf profile from dataset (red line, not important in this case), shelf_len from dataset xlabel('distance (m)'),Ylabel('深度(m)') yline(0,'——','海平面')channel_length_nanremoved=rmmissing(channel_length);% remove nan from channel data positionofnan=find(isnan(channel_length)); % finding positions of nans in channel length channel_height_lennanremoved=channel_height; % applying the length nan positions to channel height to remove their corresponding heights channel_height_lennanremoved(positionofnan)=[]; shelf_len_nanremoved=-1000.*rmmissing(shelf_len(idx,1:7)); % removing nans from shelf to combine with channel % Using a forloop to calculate slope between channel data points n=2:length(channel_length_nanremoved); for ii=2:length(channel_length_nanremoved) slope=(channel_height_lennanremoved(n)-channel_height_lennanremoved(n-1))./(channel_len_nanremoved(n)-channel_len_nanremoved(n-1)); end % Generating the yellow line representing a previous position of the channel m=mean(slope(end-9:end)) shelf_len_reversed=flip(shelf_len_nanremoved,2); % flipping shelf lengths as they start off more negative and get more positive x=horzcat(shelf_len_reversed,channel_length_nanremoved); % combining shelf and channel lengths x1=channel_length_nanremoved(end); % starting line from start of channel profile position2=find(channel_length==channel_length_nanremoved(end)); y1=channel_height(position2); y=(m*(x-x1))+y1; % determining y for given x hplot=plot(x,y); 德里克·沃恩 //www.tatmou.com/matlabcentral/profile/authors/16656283-derrick-vaughn. 标签:www.tatmou.com, 2005:问题/ 511138 2020-03-16T15:10:19Z 2020-03-16T15:10:19Z 少镜头学习(原型网络、关系网络、匹配网络) 你好。我想用少拍学习来分类数据集。我可以了解一些关于“少枪学习”(原型网络,关系网络,匹配网络)方法的想法和代码吗?我学了Python的原型网络。我正在寻找Matlab。https://github.com/abdulfatir/prototypical-networks-tensorflow/blob/master/ProtoNet-Omniglot.ipynb https://www.mathwands.com/matlabcentral/profile/authors/14262556-kong. 标签:www.tatmou.com, 2005:问题/ 511137 2020 - 03 - 16 - t15:09:38z 2020 - 03 - 16 - t15:09:38z 在ntstool中训练多时间序列的NARX 亲爱的,我所有的所有实验数据都有三次。每次序列都包括3个输入变量和一个输出变量。使用Catsamples命令,我将3个输入和Outpu数据序列转换为两个正确的单元阵列输入和输出(在此上传)。在NTSTOOL中,选择“选项单元格”我可以介绍我的输出单元数组。该工具已成功识别出它包括3个时间序列,其中1个元素的5598个元素,如下所示:目标'输出'是1x3矩阵的1x5598单元格阵列,表示动态数据:3次为5598的1个元素。然而,没有一个选择输入单元阵列的选项,正弦它具有3x5598的尺寸。这是这个工具的限制吗?有另一种方法可以训练鼻子吗?您能否向我发送一个解决这个问题的脚本? Georgios Etsias. //www.tatmou.com/matlabcentral/profile/authors/13139445-georgios-etsias 标签:www.tatmou.com, 2005:问题/ 511136 2020 - 03 - 16 - t15:07:09z 2020 - 03 - 16 - t15:08:44z 为什么0.35划分0.001返回双倍,0.34划分0.001返回int。 简单代码:>> 0.35/0.001 ans = 350.0000和>> 0.34/0.001 ans = 340我很好奇为什么会这样。如果使用0.351/0.001,返回351.0000,如果使用0.352/0.001,返回352。 还是 //www.tatmou.com/matlabcentral/profile/authors/2863242- 标签:www.tatmou.com, 2005:问题/ 511132 2020 - 03 - 16 - t14:42:40z 2020 - 03 - 16 - t15:08:08z 创建具有平均值的数组 我有一个设备可以在不同的地方测量12种不同的温度,并将其存储在一维数组中。1D阵列由480个元素组成,所以每个传感器测量480/12 = 40次。为了得到每个传感器前5个测量值的平均值,我必须计算元素1、13、25、37、49和2、14、26、38、50和3、15、27、39、51和4、16、28、40、52 ......12、24、36、48、60的平均值。这是在Matlab中成功完成的。现在我要计算设备接下来5次测量的平均值。传感器1的平均值用61,73,85,97,109计算,传感器2需要62,74,86,98,110等....当这些平均值被计算时,我想要得到40/8 =每个传感器的5个平均值,所以12*5 = 60个元素。得到的数组应该看起来像(av=平均,数字是传感器):av1,av2,av3,av4,av5,av6,av7,av8,av9,av10,av11,av12,av1,av2,av3,av4,av5,av6........(数组长度= 60) 不行在这里 //www.tatmou.com/matlabcentral/profile/authors/17789797-niet-hier. 标签:www.tatmou.com, 2005:问题/ 511128 2020 - 03 - 16 - t14:26:08z 2020 - 03 - 16 - t15:07:41z 可变步长时间在simulink中的一系列仿真-绘图困难金宝app 喂!我做了一个模型,根据负载和温度观察PEMFC堆栈的不同方面。因为每次运行模拟的步骤数都是不同的。使得该比电流的比效率无法与下一次仿真相比。我看到的唯一选择是使用一个固定的值运行,但这会使模拟花费数小时……感谢所有与替代解决方案的帮助!我把代码放在下面了。提前谢谢!这里在左边,我试图设置一个特定的值,像这样:surf(EffM) xlabel('Current (a)','FontSize',12,'FontWeight','bold') ylabel('Temp (C)','FontSize',12,'FontWeight','bold') zlabel('Efficiency (%)','FontSize',12,'FontWeight','bold') colormap(jet)和在右边;图('Name','Eff LUT') surf(CurrentM(1,:),tempA(2:Sweep+1),EffM) xlabel('Current') ylabel('Temp') colormap(jet)洞代码:Tstart=0; % Starting time for the simulation [s] Tstop=10; Sweep=20; Kelvin=273.15; PEMTemp=301; tempA=-50:10:150; tempA=tempA+Kelvin; t=length( time ); EffM=zeros(Sweep,t+40); CurrentM=zeros(10,t+40); VoltageM=zeros(Sweep,t+40); H2flowM=zeros(Sweep,t+40); ttempM=zeros(Sweep,t+40); ttempM2=zeros(Sweep,11); for x=1:Sweep %for y=1:100 %Speed = SpeedA(y); % PEMTemp44= tempA(x); PEMTemp= tempA(x); open_system('PEM_Dynamic_Temp_LUT') set_param('PEM_Dynamic_Temp_LUT/Constant6', 'value', 'PEMTemp') set_param('PEM_Dynamic_Temp_LUT', 'SimulationCommand', 'update'); sim('PEM_Dynamic_Temp_LUT',[Tstart,Tstop]) l2=length( Current ); lt=t+40-l2 tt=ones(lt,1); CurrentM(x, :)= [Current ; tt]; VoltageM(x, :)= [Voltage ; tt]; EffM(x, :)=[Eff ; tt]; H2flowM(x, :)=[H2flow ; tt]; end 阿尔弗雷德Kulldorff //www.tatmou.com/matlabcentral/profile/authors/8633077-alfred-kulldorff 标签:www.tatmou.com, 2005:问题/ 510758 2020 - 03 - 13 - t19:15:27z 2020 - 03 - 16 - t15:06:39z 矢量输入,GUI编辑文本框 嗨,我试图从用户在GUI中使用编辑文本框得到一个矢量输入,但似乎程序不认识文本框,尽管我的GUI中有它们。有人知道问题出在哪里吗?%——在pushbutton1中按下按钮时执行。函数pushbutton1_Callback(hObject, eventdata, handles) % hObject handle to pushbutton1(参见GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data(参见GUIDATA) Xn=str2num(get(handle.edit1,'string'));Yn = str2num (get (handle.edit2, '字符串'));dn = str2num (get (handle.edit3, '字符串'));类句柄没有Constant属性或名为edit1的Static方法。 Daniel Laberman. //www.tatmou.com/matlabcentral/profile/authors/17543422-daniel-liberman 标签:www.tatmou.com, 2005:问题/ 510848 2020 - 03 - 14 - t13:15:37z 2020-03-16T15:06:16Z 如何从TimeSeries变量中删除行 大家好,我有一个1x1双倍次数变量。这两个列的大小为812997x1。我想排除后索引并包括行号664410的每一行。我该怎么办?我试过在正常矩阵中这样做,但它显然不起作用:hrtimeseries.time(664410:结束,:) = []; 快乐的熊 //www.tatmou.com/matlabcentral/profile/authors/17410125-happy-bear 标签:www.tatmou.com, 2005:问题/ 448795 2019 - 03 - 07 - t12:15:40z 2020 - 03 - 16 - t15:05:12z 如何做相关的两个tiff图像文件? 找到两个tiff图像之间的像素相关,并将其存储在一个矩阵中? 是以郭瑞昭 //www.tatmou.com/matlabcentral/profile/authors/14259108-thara-c-s 标签:www.tatmou.com, 2005:问题/ 473810 2019 - 07 - 28 - t15:55:08z 2020-03-16T15:03:56Z 构建双峰正态分布曲线所需的参数是什么? 我试图构建一个双峰正态分布从曲线参数,如平均值(两个模式)和标准偏差(两个)使用matlab。我想知道这个需要的其他参数是什么。如果有特定的方程来处理这样的分布。我已经尝试在matlab中添加两个随机正态分布,它给了我一个双峰分布。但我不确定这是否是最好的方法。我对统计学很陌生,希望你能给我一些建议。非常感谢你的帮助。 Goutam Choudhury. //www.tatmou.com/matlabcentral/profile/authors/15811462-goutam-choudhury 标签:www.tatmou.com, 2005:问题/ 511135 2020 - 03 - 16 - t15:03:49z 2020 - 03 - 16 - t15:03:49z 如何在matlab中连接绘图点 我使用plot命令绘制图形。例如:情节(长度,张力,'-*');但这条评论只是给出了要点。 Karthikeyan M. //www.tatmou.com/matlabcentral/profile/authors/17427144-karthikeyan-m 标签:www.tatmou.com, 2005:问题/ 511134 2020 - 03 - 16 - t15:01:54z 2020 - 03 - 16 - t15:01:54z 用MATLAB编写代码 亲爱的Matlab支持团金宝app队,我在我的MacBook上有Matlab R2019A,OS版本为10.15.x(Catalina)。我今天试图打开它,但似乎它坐在附上的错误文件中。我搜索了互联网,似乎提交了一个问题,是一个选择,所以我是在这里。如果有时间,请检查一下检查是否有用于解决方案的GISTS。期待您的回复,感谢您的理解和支持!金宝app问候 xuechen刘 //www.tatmou.com/matlabcentral/profile/authors/17767355-xuechen-liu 标签:www.tatmou.com, 2005:问题/ 511126 2020-03-16T14:18:54Z 2020 - 03 - 16 - t15:00:23z 向情节中添加多个补丁项目 给定一个x轴“开始”索引数组和一个x轴“停止”索引数组,我如何为每个开始和停止索引之间的区域创建阴影补丁?我试图将两个数组组合成一个矩阵,并匹配最小,最大的y值,但它似乎工作得不好…示例:x_start = [43 123 238 374];X_stop = [57 135 251 394];信号ymin = -20的最小值和最大值%;ymax = 20;我想创建一些像我发现的这个python例子: 基础代谢率 //www.tatmou.com/matlabcentral/profile/authors/13784460-bmr 标签:www.tatmou.com, 2005:问题/ 511113 2020 - 03 - 16 - t12:34:57z 2020 - 03 - 16 - t14:58:23z while循环在固定值处的输出 我在几秒钟内运行时间依赖于时间依赖的模拟。我已经实现了一台winl-循环,该循环将经过的时间T_ELAPSED更新为T_ELAPSED + DT,并且当T_TOTAL是T_TOTAL是以秒为单位的预定数量时停止。现在我想在每x秒内将解决方案(一个向量)输出到文本文件,即每3600秒。当DT现在变化时,这个问题会让我的游戏有点。任何帮助都非常感谢。arjan. 阿扬Marelis //www.tatmou.com/matlabcentral/profile/authors/9445692-arjan-marelis. 标签:www.tatmou.com, 2005:问题/ 511133 2020 - 03 - 16 - t14:48:26z 2020 - 03 - 16 - t14:48:26z 我如何在oritepeak中添加机器人系统工具箱 大家好,当我尝试在orithspeak中运行我的编码时,我收到这个错误'biniaroccupancymap'需要以下一个:导航工具箱机器人系统工具箱错误在自定义(无故意代码)2(第8行)地图= binaryoccupancymap(100,100);我如何解决它? 阿卜杜勒阿齐兹的瓦 //www.tatmou.com/matlabcentral/profile/authors/11366301-wafa-abdulaziz 标签:www.tatmou.com, 2005:问题/ 508784 2020 - 03 - 03 - t16:55:27z 2020-03-16T14:45:31Z SQL Server Compact数据库文件 是否有人成功访问了包含在SQL Server精简数据库文件(.SDF)中的数据?如果有,你能分享其中的步骤吗(需要的驱动程序,连接字符串等)?谢谢。 Bruce MacWilliams. //www.tatmou.com/matlabcentral/profile/authors/8745627-bruce-macwilliams. 标签:www.tatmou.com, 2005:问题/ 510740 2020 - 03 - 13 - t17:02:39z 2020 - 03 - 16 - t14:43:31z 如何对余弦距离进行分类 你好!我是Matlab的初学者。我有一个由90个数据组成的数据集(10个标签x 9数据)。我可以了解基于余弦距离或欧几里德距离的分类吗? https://www.mathwands.com/matlabcentral/profile/authors/14262556-kong. 标签:www.tatmou.com, 2005:问题/ 511129 2020 - 03 - 16 - t14:36:00z 2020 - 03 - 16 - t14:42:54z 用颜色填充物体内部的空间 你好,我如何填充我下面的对象与颜色内部? 安Phan越南 //www.tatmou.com/matlabcentral/profile/authors/17631288-anh-phan-viet 标签:www.tatmou.com, 2005:问题/ 511093 2020 - 03 - 16 - t10:55:38z 2020 - 03 - 16 - t14:42:15z 创建行X列的MaxTrix,并在循环中添加值(列 - WISE) 我正在尝试将具有相同行数的矩阵添加到循环中的更大矩阵列。我该怎么做?百分比存储所有值的大型数组BIGARRAY =零(大小(array1,1),大小(array4d,4)* 5);对于JAC = 1:尺寸(array4d,4)jacmap = array4d(:::,jac);%233333 x 35;%从数组获取k = 1:size(datacoords,1)%数组的图像,以存储5个采样点singlearray =零(size(array1,1),5)的每个图像中的提取值;%23333 x 5行= datacoords(k,:);行= table2array(行);%让我们为每个点(5个采样点)分开坐标(5个采样点)ptx =(行(1:5));pty =(行(6:10));PTZ =(行(11:15))%来自图像%的提取值在VQ = Interp3(Jacmap,PTX,PTY,PTZ)中插值。 singleJac(k,:) = Vq; end %For each image add singleJac array to bigArray - starting at 1:5 then 6:10 then 11-15, 16-20 ... 31-35 (colomn-wise) %note Single jac and bigArray have the same number of rows bigArray(:,1:5) = singleJac(:,:); end Lameck Amugongo //www.tatmou.com/matlabcentral/profile/authors/5040406-lameck-amugongo. 标签:www.tatmou.com, 2005:问题/ 511131 2020-03-16T14:39:32Z 2020-03-16T14:39:32Z 如何找到有关ANN中特定功能的输出值的输入的最佳值? 我有3个输入(x1,x2,x3)和4个输出(y1,y2,y3,y4)有60个数据集。我想知道是否y1和y2是最小的,y3是最大的,y4在特定的区间内,输入的最优值是多少。 在Morshedlou //www.tatmou.com/matlabcentral/profile/authors/14461673-amid-morshedlou 标签:www.tatmou.com, 2005:问题/ 50429 2012-10-10T19:34:06Z 2020-03-16T14:36:56Z 我突然不能再保存m文件了。我能做什么呢? 当我创建一个新的m文件,并想“保存为…”,它不会改变它的名字从“untitled”在编辑器和小星星告诉I是未保存不会消失。然后,当我打开并更改现有的m文件时,我可以照常保存它。我使用的是版本8.0.0.783 (R2012b)。谢谢你的帮助!! Sascha //www.tatmou.com/matlabcentral/profile/authors/3761175-sascha. 标签:www.tatmou.com, 2005:问题/ 511130 2020 - 03 - 16 - t14:36:40z 2020 - 03 - 16 - t14:36:40z 导出频谱分析仪跟踪工作区或文件 嗨,正如标题所说,我想了解如何从Simulink中从Spectrum Analyzer导出跟踪(DBM)到工作区或优选地到外部(Excel电子表格)文件?金宝app Derek Eccles. //www.tatmou.com/matlabcentral/profile/authors/5869291- 标签:www.tatmou.com, 2005:问题/ 511121 2020 - 03 - 16 - t13:07:54z 2020-03-16T14:34:15Z Matlab不会毫无怨言地保存脚本 大家好,我在Matlab中遇到越来越多的问题,但最后一个真的让我很困惑。我创建了一个脚本并试图保存它。Matlab只是没有保存它(它继续显示为untilted),没有提供错误消息。我最终退出了Matlab(不得不等待很长时间重新启动),只是手动保存脚本在一个文本文件。我有在文件夹中写入的权限,脚本名称不包含空格或特殊字符,也不太长:名称是check_noise.m。还有其他人遇到过这个问题吗?我真的不明白。谢谢 Mireia Torralba. //www.tatmou.com/matlabcentral/profile/authors/5692723-mireia-torralba 标签:www.tatmou.com, 2005:问题/ 229857 2015-07-14T04:00:00:00Z 2020 - 03 - 16 - t14:32:35z 为什么我在Linux上运行安装程序时,我会看到“准备安装文件......完成......”,但未安装MATLAB? 当在Linux上运行安装程序时,我看到下面的终端:准备安装文件…安装…完成了。然而,安装程序没有启动,MATLAB也没有安装。 MathWorks支金宝app持团队 //www.tatmou.com/matlabcentral/profile/authors/4622813-mathworks-金宝appsupport-team 标签:www.tatmou.com, 2005:问题/ 511125 2020 - 03 - 16 - t14:16:14z 2020-03-16T14:30:53z 在循环中创建有趣结构 嗨,作为一个血腥的初学者,我不知道我如何能写一个循环,它应该以象征性的方式总结一个特定的术语。我需要有趣= @ (x) x (1) * (1 - exp (-xdata / x (2))) + x (3) * (1 - exp (-xdata / x (4))) + x (5) * (1 - exp (-xdata / x (6))) + x (7) * (1 - exp (-xdata / x (8))) - ydata;但是我想写一个循环,所以术语x(1)*(1 - exp(-xdata/x(2))被添加到我想要的经常。我需要它在福斯特模型中为可变数量的rc项进行热计算,它后来被转换为Cauer模型。我的代码一般是:prompt ={'输入所需的RC-Terms'};dlgtitle =“RC-Terms”;definput = {"};选择。翻译=“特克斯”;答案= inputdlg(prompt,dlgtitle,[1 40],definput,opts); amount = str2double(answer{1}); x0= 1:1:2*amount; % starting position for fit algorithm for i=1:2:2*amount x0(1,i)=0.1; for k=2:2:2*amount x0(1,k)=1; end end options = optimoptions(@lsqnonlin,'Algorithm','levenberg-marquardt'); fun= %this is, where the loop should be for a variable amount of Rc terms x = lsqnonlin(fun,x0,[],[],options); ... 兰布斯 //www.tatmou.com/matlabcentral/profile/authors/16703480-lureb 标签:www.tatmou.com, 2005:问题/ 510605 2020 - 03 - 12 - t20:50:32z 2020-03-16T14:28:08Z 是否可以在图形的文本框旁边放置符号。 文本框的代码。txt = sprintf(['resfreq:',... num2str(xy(1)),'hz');txtbox =注释('textbox',[.6 .33 .1 .1],'string',... [txt]);set(txtbox,'backgroundcolor','红色')设置(txtbox,'facealpha',0.2)设置(txtbox,'linewidth',1)在这里我有我的图表的图片。我想在文本框中放置相同的三角形。 EirikurBernharžsson. //www.tatmou.com/matlabcentral/profile/authors/15951123-eirikur-bernhardsson. 标签:www.tatmou.com, 2005:问题/ 511127 2020 - 03 - 16 - t14:22:55z 2020 - 03 - 16 - t14:22:55z MATLAB中的ADC门限建模 如何建模ADC阀值的变化由于电阻的线性梯度?我实现了理想的ADC与地板功能,现在我想添加变化到阈值在每个水平,我想模型变化的每个阈值作为高斯变量σ =0.1,它是如何做到的?如果有人提供帮助或任何提示,我真的很感激。我可以在SIMULINK中建模吗金宝app Maruthi prasanna C //www.tatmou.com/matlabcentral/profile/authors/13404122-maruthi-prasanna-c 标签:www.tatmou.com, 2005:问题/ 511041 2020-03-16T03:18:20z 2020-03-16T14:19:52Z Uigetfile在Matlab在线错误 当我运行此行时,我收到此错误。不太确定如何解释它。提前感谢您的帮助!我在线使用matlab。[f_name p_name] = UigetFile('*。垫','选择输入数据文件','Multipelect','On');索引超过数组元素(0)的数量。误差在matlab.ui.internal.dialog.FileChooser / updateFromDialog(线215)obj.PathName =文件路径{1};matlab.ui.internal.dialog.filechooser / pedureialog / localupdate(第95行)UpdateFromDialog(OBJ,UpdateDataObject(OBJ))中的错误。 Michael Chang //www.tatmou.com/matlabcentral/profile/authors/8255319-michael-chang 标签:www.tatmou.com, 2005:问题/ 497442 2019 - 12 - 19 - t17:26:49z 2020-03-16T14:17:46Z 将矩阵保存为带有投影的。tiff文件? 我有一个矩阵(618x1169单),值范围从-6e(36)到38355.4,我试图保存为一个光栅/Tiff。我宁愿保留导入的栅格中的地理空间信息,但是,如果我能找到一种方法,在没有任何地理空间数据的情况下保存栅格,我可以稍后重新设置投影。我已经尝试了任何不同的解决方案,从这个网站,但我不能找金宝搏官方网站到任何工作。我已经附上了导入的。tiff文件的。mat文件。前一个代码块有这样的错误:输入R是一个map. rsterref . mapcellsreference对象,表明您正在一个投影坐标系统中工作。如果是,则通过设置“CoordRefSysCode”或“GeoKeyDirectoryTag”可选参数的适当值来指定投影坐标系统。后者的结果是一个光栅,看起来像附加的图像,这是颠倒的美国。我不认为这是因为我把它投影错了。最后,我希望将这个矩阵保存为tif格式,附带或不附带任何地理空间信息,因为我可以在QGIS中设置它。%% Atempt 1:我尝试了以下操作,结果出错。 [tifRaster, R] = geotiffread('importRaster.tif'); % Numbers are transformed (not shown) but the result is still a 618x1169 single matrix. geotiffwrite('exportRaster.tif',tifRaster,R); % Error %% Attempt 2: I have also tried the following based on a previous Answer but the projection is messed up and my raster is flipped. [tifRaster] = geotiffread('importRaster.tif'); % Numbers are transformed (not shown) but the result is still a 618x1169 single matrix. R=georasterref(); R.RasterSize=size(tifRaster); geotiffwrite('exportRaster.tif',tifRaster,R); % Incorrect result Dankur Mcgoo //www.tatmou.com/matlabcentral/profile/authors/11499972-dankur-mcgoo 标签:www.tatmou.com, 2005:问题/ 511119 2020-03-16T13:07:26Z 2020-03-16T14:13:43Z 在解有初始条件的微分方程时需要帮助。请帮助我纠正我的代码。 我的目标是在时间t=0到1000 syms x1(t) syms x2(t) %constants k1=0.015;k2=0.025;k3=0.038;α= 0;k = 7 = 2;%初始条件x1(0) = 0.45 + 0.05 *α;x2(0) = 0.65 - -0.15 *α;t = 0:1000;K_lower = k1 +α(k2-k1);K_upper = k3-alpha (k3-k2);X_1 = dsolve (diff (x1, t) = = (K_lower) * (x1) * (1 - (x2 / k)) * (x1)、x1(0) = = 0.45 + 0.05 *α);X_2 = dsolve(差异(x2, t) = = (K_upper) * (x2) * (1 - (x1 / k)) * (x2)、x2(0) = -0.15 = 0.65 *α);使用sym/ subsgn出错(第951行)索引或函数定义无效。 Indexing must follow MATLAB indexing. Function arguments must be symbolic variables, and function body must be sym expression. Error in Initial_Conditions_alpha (line 4) x1(0)=0.45+0.05*alpha; 赛义德 //www.tatmou.com/matlabcentral/profile/authors/4465820. 标签:www.tatmou.com, 2005:问题/ 511124 2020-03-16T14:11:48Z 2020-03-16T14:11:48Z 金宝appSimulink - 通过串口发送和接收浮动 嗨,我花了一些时间在这个问题上。想问问有没有人愿意帮忙吗?我有一个在Arduino Mega上运行的机器人,由Simulink模型控制。金宝app内部和外部模式都可以工作。该模型控制电机,读取正交编码器,从IMU传感器接收数据,等等。都是好的。我想通过串行接口给机器人发送一些参数,串行接口基本上是一个xbee对,但有一个基本问题。这里是系统的基本框图:usb到serial0的连接只是为了监控信号和上传模型。当模型部署到机器人上时就不需要了。我准备了两个示例模型来澄清这个问题。 Here is the model to send 4 numbers each are 4 byte single values over /dev/ttyUSB0 (Xbee connected to computer) This model works fine and sends all 4 numbers in a 4-bytes data type. Then, on the Arduino side, I want to recreate those 4 numbers using the bytes received. Here is the Arduino-side model: I have a big problem with what I receive in this side. I cannot recreate the numbers back. There is a very good explanation in this page. But I couldn't make it possible in my case. The xbee part would seem making things more complicated. If so, you can just assume the serial port was directly connected to arduino serial port 3. Long story short, I couldn't receive multiple 4-byte numeric values over serial port and recreate them on arduino using Simulink. I will appreciate it if someone helps. Thanks. Zengin太空 //www.tatmou.com/matlabcentral/profile/authors/6785369-tarik-zengin 标签:www.tatmou.com, 2005:问题/ 511006 2020 - 03 - 15 - t19:58:41z 2020 - 03 - 16 - t14:06:28z 如何在同一功能中放置目标和约束功能? 大家好,我正在研究一个非线性不等式约束的优化问题,我希望把目标函数和约束函数放在同一个函数中;问题是,我的目标函数不是一个代数表达式,而是一个隐含的值,从查找表,我定义我的目标函数如下函数OBJ = OBJ (X) OBJ = X(11);%,其中x11是一个来自生成的LUT端点的值,这里是非线性约束函数function [C, CEQ] = NonLinCon(X, LUT1, LUT2, IP) %矢量化设计变量DOF.M(1)。N = X (: 1);DOF.M(2)。N = X (:, 2);DOF.M(3)。N = X (: 3);DOF.M(4)。N = X (: 4);DOF.M(5)。N = X(:,5); DOF.M(1).S = X(:,6); DOF.M(2).S = X(:,7); DOF.M(3).S = X(:,8); DOF.M(4).S = X(:,9); DOF.M(5).S = X(:,10); DOF.R = IP.R; DOF.VDS_MARGIN = IP.VDS_MARGIN; DOF.IB = X(:,11).*1e-3; DOF.VDD = IP.VDD; DOF.CL = IP.CL; DOF.VICM = IP.VICM; DOF.VOCM = IP.VOCM; DOF.M(6).N = DOF.M(5).N; DOF.M(6).S = DOF.M(5).S; [~, OP] = mainfnc(LUT1,LUT2,DOF); % Nonlinear Inequality Constraints C(:,1) = IP.UGF ./ double(OP.UGF) - 1; C(:,2) = IP.PM ./ double(OP.PM) - 1; C(:,3) = log10(IP.AVDC) ./ log10(double(OP.AVDC)) - 1; C(:,4) = IP.FO ./ double(OP.FO) - 1; C(:,5) = IP.FP1 ./ double(OP.FP1) - 1; c(:,6) = IP.VO_SWING ./ double(OP.VO_SWING) - 1; CEQ = []; end i cant seem to follow the example provided in the documentation (solver based approach) 优素福refaat //www.tatmou.com/matlabcentral/profile/authors/14452778-youssef-refaat 标签:www.tatmou.com, 2005:问题/ 510982 2020-03-15T16:48:04z 2020-03-16T14:04:29z 如何在文件夹名称列表中找到精确的字符串匹配 您好Ereveryone,我有一个问题尝试根据子文件夹名中包含的精确字符串名称从一系列文件中提取数据。我所拥有的问题是将数据提取到y_node和xy_node,因为包含无法区分“y_high”和'xy_high',并将所有数据提取到y_high变量中。我尝试过包含,匹配,strcmp,strfind等,但我无法正确地匹配并将数据分配给正确的单元格数组。我无法附加原始数据,因为它太大了,但文件夹名称列表已附加。有人可以帮忙吗?模式= [“no_high1_add_on”,“x_high1_add_on”,“y_high1_add_on”,“xy_high1_add_on”];对于k = 1:numperofofolders%get此文件夹并打印出来。thisfolder = listOffoldernames {k};如果包含(thisfolder,图案(1))j = 1;elsefif包含(thisfolder,图案(2))j = 2; elseif contains(thisFolder,pattern(3)) J = 3; elseif contains(thisFolder,pattern(4)) J = 4; else continue end filePattern = sprintf('%s/*node.csv', thisFolder); baseFileNames = dir(filePattern); numberOfImageFiles = length(baseFileNames); if numberOfImageFiles >= 1 % Go through all those files. for f = 1 : numberOfImageFiles fullFileName = fullfile(thisFolder, baseFileNames(f).name); if J == 1 NO_NODE{k} = importdata(fullFileName); elseif J == 2 X_NODE{k} = importdata(fullFileName); elseif J == 3 Y_NODE{k} = importdata(fullFileName); elseif J == 4 XY_NODE{k} = importdata(fullFileName); else end end end fprintf(' Folder %s has no files in it.\n', thisFolder); end 理查德里昂 //www.tatmou.com/matlabcentral/profile/authors/10516972-richard -rees. 标签:www.tatmou.com, 2005:问题/ 313108 2016 - 11 - 20 - t10:53:07z 2020 - 03 - 16 - t13:58:49z 如何将2D图形转换为3D? 我写了一个代码,可以给我们一个2D机翼翼型与具体的数字点和协调的每一个,有没有任何例子或文件,使我的翼型3D只通过扩展它或通过控制它的投影 oussama himani souadka //www.tatmou.com/matlabcentral/profile/authors/7219840-oussama-souadka 标签:www.tatmou.com,2005:问题/ 101806 2010 - 09 - 08 - t20:47:00z 2020 - 03 - 16 - t13:54:48z 如何将MATLAB图(.fig)文件插入多个子图? 我有两个MATLAB图(.fig)文件,我想插入到一个新图的子图。 MathWorks支金宝app持团队 //www.tatmou.com/matlabcentral/profile/authors/4622813-mathworks-金宝appsupport-team 标签:www.tatmou.com, 2005:问题/ 511090 2020 - 03 - 16 - t10:51:44z 2020 - 03 - 16 - t13:51:42z 我如何将两个不同的向量插入到相同的长度 您好社区我有两个不同的数据集.xlsx和.csv格式。两者都是通过记录物理传感器进行的。所有数据的引用是在两种文档中表示的RPM(每分钟的圆数)。此外,在另一个文件中还有一个“燃料使用”和其他文档中的“电源测量”。我的问题是我需要计算燃油效率 - >与发动机的功率电平相比燃料使用率。但这两种矢量尺寸为1:770和1:4620。这使得可以比较数据。有没有办法插入两个向量,因此向量以800rpm开始,并在2500rpm下停止,使用10rpm步骤,并将此RPM的电流连接到燃料使用和功率电平?我真的很感激解决这个问题。 疯狂的彼得伦 //www.tatmou.com/matlabcentral/profile/authors/8682069-mads-petersen 标签:www.tatmou.com, 2005:问题/ 507605 2020 - 02年- 26 - t06:58:22z 2020 - 03 - 16 - t13:48:29z 从参数对象中获取频率 我已经导入了一个试金石文件(s2p)到一个参数对象使用参数函数在RF工具箱:我想从Example_s_param得到频率向量。我可以看到它时使用disp(Example_s_param) -然后它返回:NumPorts: 2频率:[1001×1 double]参数:[2×2×1001 double]阻抗:50我想把“频率”保存在一个新的矢量中,我可以使用它来绘制东西。不知怎么的,我想不出怎么做这件事。 Frederikke约翰逊 //www.tatmou.com/matlabcentral/profile/authors/17536495-frederikke-johansson 标签:www.tatmou.com,2005:问题/ 510474 2020-03-12T07:54:48Z 2020 - 03 - 16 - t13:48:20z 卷积信号的振幅? 大家好,我正在建模一些测量设备,我需要Matlab的Conv功能。因此,让我们定义a = conv(b,c);其中B有20 k点和C 5 k点。一个将有24999分,但它的幅度会发生什么?我已经尝试了千里的模拟,但我看不到幅度之间的任何关系。换句话说,我总是发现幅度具有系数因素,但我不知道它来自哪里。我已经尝试过介绍信号的Samplimg频率,但没有。提前谢谢。 亚历山德罗Mingotti //www.tatmou.com/matlabcentral/profile/authors/9027146-alessandro-mingotti 标签:www.tatmou.com, 2005:问题/ 511123 2020 - 03 - 16 - t13:43:56z 2020 - 03 - 16 - t13:43:56z 我有12个对象,只有10个对象内部有一个黄色点。如何只用黄点提取物体的ID? 黄色的圆点不在物体的中心。我已经为每个对象创建了一个黄色的蒙版,但是我正在努力创建一个for循环来提取只有黄色圆点在里面的对象的id 乔尔Nunes //www.tatmou.com/matlabcentral/profile/authors/15966343-joel-nunes 标签:www.tatmou.com, 2005:问题/ 511122 2020 - 03 - 16 - t13:36:13z 2020-03-16T13:41:58z 如何在simulink电气中获取实时信号金宝app 我们的目标是用真实的信号来模拟电子峰值检测器。试图改变矩阵的S-PS转换器。 亚当拉克赫里 //www.tatmou.com/matlabcentral/profile/authors/17693825-adam-lakhdari 标签:www.tatmou.com, 2005:问题/ 511105 2020 - 03 - 16 - t11:58:48z 2020 - 03 - 16 - t13:39:42z 使用struct数组时Calllib函数错误 大家好,我正在尝试使用C代码生成的共享库。我的目的是将struct_1的地址作为输入发送给C函数,然后在C函数中改变struct_1的值,并将struct_1的地址从C函数中取回给MATLAB。我有一个结构,如struct_1 = struct('Var_1', Var_1, 'Var_2', [Var_2, Var_2], 'Var_3', char(zeros(1,10)))。我在MATLAB中构造了这个结构,同样的结构也在C头文件中构造。Var_1的类型是结构,Var_2的类型是1x2数组,它有一个struct组件。此外,Var_3是一个字符数组。我在构造struct_1之前定义了var_1和var_2结构。当我使用' calllib('libStruct', 'structFnc', struct_1);',我采取'不能转换数据值为字段Var2由于错误:数组必须是数字或逻辑或一个指针指向1 '错误。我试着struct_1。Var_2 = libpointer('cstring');' but Var_2 variable become a 1x1 libpointer, actually it was a struct array. I took same error for char array variable, Var_3. How can I use structure which is constructed with struct array and char array members in calllib function? I would be very glad if you help! 坎Beyhan //www.tatmou.com/matlabcentral/profile/authors/12199569-furkan-beyhan. 标签:www.tatmou.com, 2005:问题/ 511118 2020 - 03 - 16 - t13:05:35z 2020 - 03 - 16 - t13:29:12z 继续如果文件不存在 - pop_loadset 我希望我的pop_events函数要在目录中执行到所有'.set'文件。文件名为P [1:44] _0 [1:3] .set。我的代码如下:sub = [1:44];run = [1:3];对于i = sub for j =运行eeg = pop_loadset('filename',sprintf('p0%i_%i.set',i,j),'filepath','... / 2_correcttriggers /');EEG = EEG_CHECKSET(EEG);pop_expevents(eeg,sprintf('/ p0%i_%i.csv',i,j),'秒');结束结束但有一些缺少的文件,如p02_03.set,所以for循环返回此消息返回此文件:使用load无法读取文件'/ 2_correcttriggers / p02_3.set'时出错。没有这样的文件或目录。pop_loadset(行119)tmpvar = load(' - mat',filename)中出错; Error in extract_log_files (line 6) EEG = pop_loadset('filename',sprintf('p0%i_%i.set', i,j),'filepath','.../2_correctTriggers/'); How can I write a code that skips inexistent files and continue the loop? I would really appreciate any help, Cheers 布鲁诺曼苏尔 //www.tatmou.com/matlabcentral/profile/authors/17704272-bruno-mansur. 标签:www.tatmou.com, 2005:问题/ 389422 2018 - 03 - 20 - t09:30:13z 2020 - 03 - 16 - t13:22:27z 我可以使用学生执照吗? 你好,这可能是一个小琐碎,但我在我目前的大学,我们不使用matlab,但我开始一个研究生课程在另一所大学在9月,它将被使用。我现在有资格使用学生许可证学习matlab吗?Thankis 理查德麦克尼尔 //www.tatmou.com/matlabcentral/profile/authors/12429579-richard-mcnair 标签:www.tatmou.com, 2005:问题/ 511044 2020-03-16T03:59:12z 2020 - 03 - 16 - t13:15:14z 求旋转矩阵。试图得到滚动和俯仰,但求解器返回空结构。 目前正在进行四轴飞行器模拟。我有一个想要的推力矢量,t = sin30 cos45 a1+ sin30 sin45 a2+ cos30 a3,想要的偏航角,= 45。因为我们使用的是一个欠驱动系统,所以我试图求解使向量b3 =[0,0,1](身体固定参考系中的推力方向)与t方向对齐的旋转矩阵。我的代码包含在下面。问题是它输出一个空的符号结构,没有警告或错误:我做错了什么?这是我的理论,我的实施,还是两者都有问题?谢谢你!t =[信德(30)* cosd(45),信德(30)*信德(45),cosd (30)];%期望推力矢量psi = 45;%期望偏航角b3 = [0;0;1];%身体-固定单位推力矢量符号 %setting up to solve what's left of the rotation matrix eqn = [[cosd(psi)*cosd(theta)-sind(phi)*sind(psi)*sind(theta), -cosd(phi)*sind(psi), cosd(psi)*sind(theta)+cosd(theta)*sind(phi)*sind(phi); cosd(theta)*sind(psi)+cosd(psi)*sind(phi)*sind(theta), cosd(phi)*cosd(psi), sind(psi)*sind(theta)-cosd(theta)*sind(phi)*cosd(psi); -cosd(phi)*sind(theta), sind(phi), cosd(phi)*cosd(theta)] * b3 == t/norm(t)]; %equation to be solved (general form of the rotation matrix multiplied by body-fixed thrust aligned with t) S = solve(eqn,[phi theta]); %solve 迈克尔李 //www.tatmou.com/matlabcentral/profile/authors/17180838-michael-le.