https://la.mathworks.com/matlabcentral/answers/questions MATLAB答案-新问题 2020 - 03 - 28 - t16:11:56z 标签:la.mathworks.com, 2005:问题/ 513417 2020 - 03 - 27 - t16:50:35z 2020 - 03 - 28 - t16:11:56z VLookup多个条件if语句 嗨,我想修改这段代码,以执行2列的VLookup,并返回同一行中相应列元素之一的元素?有人能帮我做一下这个函数的if语句吗?下面是我在Mathworks上找到的一个函数,我想修改它:所以我需要两个查找列,而不是一个查找列。//www.tianjin-qmedu.com/matlabcentral/fileexchange/29233-vlookup-similar-to-ms-excel-function 詹姆斯 https://la.mathworks.com/matlabcentral/profile/authors/3309541-james 标签:la.mathworks.com, 2005:问题/ 513441 2020 - 03 - 27 - t18:25:26z 2020 - 03 - 28 - t16:10:33z 如何通过运行程序来解决这个问题? 我正在使用Matlab进行医学图像分类,我得到了这个问题:注意:我使用了预先训练的网络(alexnet)与.dicom文件数据集。首先我准备我的设计网络,其次,我运行我的代码。>> deepNetworkDesigner >> shivanclassified net = SeriesNetwork with properties: Layers: [25×1 nnet.cnn.layer.Layer] InputNames: {'data'} OutputNames: {'output'}错误使用trainNetwork(第170行)训练图像的大小为227x227x1,但输入层期望图像的大小为227x227x3。错误在shivancategory(第36行)net= trainNetwork(augimdsTrain,layers_1,options) net=alexnet imds = imageDatastore('lung dataset-Labeled',…' inclesubfolders ',true, 'LabelSource','foldernames',…%这个标签由文件夹名称'FileExtensions','.dcm','ReadFcn',@readDicomDatastoreImage);% this a function [imdsTrain,imdsValidation] = splitEachLabel(imds,0.7);imageDataAugmenter(…“RandRotation”,-20年,20,…“RandXReflection”,1,… 'RandYReflection',1,... 'RandXTranslation',[-3 3], ... 'RandYTranslation',[-3 3]); %augimdsTrain = augmentedImageDatastore([224 224],imdsTrain,'DataAugmentation',augmenter); %augimdsValidation = augmentedImageDatastore([224 224],imdsValidation,'DataAugmentation',augmenter); augimdsTrain = augmentedImageDatastore([227 227],imdsTrain); augimdsValidation = augmentedImageDatastore([227 227],imdsValidation); options = trainingOptions('rmsprop', ... 'MiniBatchSize',10, ... 'MaxEpochs',20, ... 'InitialLearnRate',1e-3, ... 'Shuffle','every-epoch', ... 'ValidationData',augimdsValidation, ... 'ValidationFrequency',3, ... 'Verbose',false, ... 'Plots','training-progress'); net = trainNetwork(augimdsTrain,layers_1,options) [YPred, probs] = classify(net,augimdsValidation); accuracy = mean(YPred ==imdsValidation.Labels) figure cm=confusionchart (imdsValidation.Labels, YPred); shivan artosh https://la.mathworks.com/matlabcentral/profile/authors/16817855-shivan-artosh 标签:la.mathworks.com, 2005:问题/ 513576 2020 - 03 - 28 - t14:17:47z 2020 - 03 - 28 - t16:09:20z 如何解决这个错误'未定义的函数或变量'uiopen'。' 我面临的问题,在matlab中打开任何文件。在命令窗口显示此错误“未定义的函数或变量'uiopen'.”。这个窗口如图所示。我怎么解决呢? riya shahrin https://la.mathworks.com/matlabcentral/profile/authors/15983192-riya-shahrin 标签:la.mathworks.com, 2005:问题/ 513564 2020 - 03 - 28 - t12:38:09z 2020 - 03 - 28 - t16:08:45z 计算长期日均线 我设法做到月均是这样的。Mat = randi([0 14600], 730,5,2);Sc1 = (datetime(1981,1,1):datetime(1982,12,31))';Splitmat = num2cell(permute(mat, [1 3 2]), [1 2]);TT1 =时间表(sc1,splitmat{:});monthlyaverage = retime(TT1, 'monthly', 'mean');如果我做monthlyaverage = retime(TT1, 'daily', 'mean');它将返回与每日数据相同的值。然而,我感兴趣的是长期的日平均值,这意味着一年中的平均一天(第一天…天,365)。 The final answer number of rows will be only 365. is there similar approach that is concise like retime to do it? thanks Tunechi https://la.mathworks.com/matlabcentral/profile/authors/3196327-tunechi 标签:la.mathworks.com, 2005:问题/ 513588 2020 - 03 - 28 - t15:35:51z 2020 - 03 - 28 - t16:04:45z 如何纠正矩阵维数不一致误差 图清晰;clc;V = 1.0;N =[0.00 0.10 0.12 0.18];U = linspace(0,2);% % i = 1:长度(n)σ=((1我。* u-1-v。^ 2)。/ (v ^ 2 u。^ 2 + 1-2i。* u)) * (1. / (v。^ 2 + 1));sigma = n*((1i.*u-1-v.^2)./((1+n). sigma = n*(1i.*u-1-v.^2)./((1+n). sigma = n^ 2 + v ^ 2)。* (v ^ 2 u。^ 2 + 1-2i。* u)) * (1 - (v / v。^ 2 + 1)));W = sigma + sigmapri;情节(u,真实(w))结束% %包含(* \ \ωτ)ylabel(‘\σ(\ω)/ \ sigma_o”) 撒母耳Suakye https://la.mathworks.com/matlabcentral/profile/authors/10402734-samuel-suakye 标签:la.mathworks.com, 2005:问题/ 513590 2020 - 03 - 28 - t15:47:11z 2020 - 03 - 28 - t16:03:25z 绘制函数y轴 这就跟你问声好!我必须用绘图函数画出两个向量1000x1。>> T01 = linspace(-40,10,1000);>> RH = linspace(1100,1000);>> c2 = 150;>> RH_cond(T01, RH,c2);>> t01 = t01 ';向量是“T01”和函数RH_cond的输出。这就是结果。但我想看到所有的y轴,从1到100。 Thank you ! Klaudio Myrtaj https://la.mathworks.com/matlabcentral/profile/authors/17239824-klaudio-myrtaj 标签:la.mathworks.com, 2005:问题/ 513583 2020 - 03 - 28 - t14:38:55z 2020 - 03 - 28 - t16:02:52z 我怎样才能把几个文件结合起来。无花果在一起 我有几个文件,它们的格式是。图(实际上它们是图形),我需要把它们组合在一起进行比较。请问我可以使用哪个功能? 尼鲁法尔,爸爸,亚当 https://la.mathworks.com/matlabcentral/profile/authors/17630142-niloufar-baba-adam 标签:la.mathworks.com, 2005:问题/ 513591 2020 - 03 - 28 - t15:47:13z 2020 - 03 - 28 - t16:01:46z 绘制函数y轴 这就跟你问声好!我要用绘图函数画出两个向量。>> T01 = linspace(-40,10,1000);>> RH = linspace(1100,1000);>> c2 = 150;>> RH_cond(T01, RH,c2);>> t01 = t01 ';向量是“T01”和函数RH_cond的输出。这就是结果。但我想看到所有的y轴,从1到100。 Thank you ! Klaudio Myrtaj https://la.mathworks.com/matlabcentral/profile/authors/17239824-klaudio-myrtaj 标签:la.mathworks.com, 2005:问题/ 513561 2020 - 03 - 28 - t12:26:23z 2020 - 03 - 28 - t16:01:33z 矩阵除以向量的问题 嗨,我有一个20301*20301的矩阵和一个20301*1的向量…(在201次迭代之后,从单元格202开始计算数字。当我尝试使用A\b除法时,错误“警告:奇异矩阵..”出现,我的答案只是nan。我和一个朋友比较了我的答案,当他得到了a和b的确切值时,他的除法起作用了,他得到了实际的值。我想知道有没有人能解释一下这个情况 只Maaz Madha https://la.mathworks.com/matlabcentral/profile/authors/14625478-maaz-madha 标签:la.mathworks.com, 2005:问题/ 330889 2017 - 03 - 20 - t16:56:05z 2020 - 03 - 28 - t16:00:06z Matlab在AMD Ryzen上性能好吗? 你好,我想为Matlab买一个新的CPU,但我不确定新的AMD Ryzen 1800X在Matlab上是否表现良好。我知道性能取决于您正在运行的代码,但是可能有些Ryzen所有者可以发布“bench”函数的结果。谢谢。:) TeichEnterich95 https://la.mathworks.com/matlabcentral/profile/authors/5815173-teichenterich95 标签:la.mathworks.com, 2005:问题/ 513581 2020 - 03 - 28 - t14:37:35z 2020 - 03 - 28 - t15:57:50z 我怎样才能把几个文件结合起来。无花果在一起 我有几个文件,它们的格式是。fig(实际上它们是图形),我需要将它们组合在一起进行比较。请问我可以使用哪个功能? 尼鲁法尔,爸爸,亚当 https://la.mathworks.com/matlabcentral/profile/authors/17630142-niloufar-baba-adam 标签:la.mathworks.com, 2005:问题/ 513578 2020 - 03 - 28 - t14:23:14z 2020 - 03 - 28 - t15:56:57z 使用parfor loops /omp pragma在mexed文件上运行相同的伪随机数 我一直在对我的parfor循环子程序进行mexing,以使它们更快一些。使用parpool,我能够创建相同的RandStream发送给工作人员,这样我每次都能得到相同的解决方案。我一直试图对我的mexed文件做同样的事情,但我无法这样做。我发现可以“清除mex”内存,这将重复相同的伪随机数,每次调试都很好。然而,我想做的是能够得到不同的结果不同的运行使用不同的种子值。但如果我在清除mex后选择相同的种子,它总是会给出相同的结果,但与另一颗种子不同。Rng()似乎不能工作。我还没能找到办法。先谢谢你 卡洛斯Larriba-Quest https://la.mathworks.com/matlabcentral/profile/authors/8901034-carlos-larriba-quest 标签:la.mathworks.com, 2005:问题/ 287525 2016 - 06 - 03 - t17:50:57z 2020 - 03 - 28 - t15:47:16z 如何在文件交换上重命名提交的工具? 随着工具功能的发展,这个名称不再准确。但是,在File Exchange上提交工具后,似乎没有办法重命名工具。在这些情况下,最好的做法是什么?从我的初步搜索来看,实现这一点的唯一方法似乎是重新提交工具并“迁移”到一个新版本。然而,这项活动似乎也没有得到直接支持。万博1manbetx大多数人通过简单地从旧版本的描述部分链接到新工具版本来做到这一点。 莫妮卡Jaskolka https://la.mathworks.com/matlabcentral/profile/authors/4417791-monika-jaskolka 标签:la.mathworks.com, 2005:问题/ 513589 2020 - 03 - 28 - t15:43:34z 2020 - 03 - 28 - t15:43:34z 基于simulink的三相交流发电机外部特性研究万博1manbetx 我是使用这个软件的新手,我想问一下如何使用simulink确定电阻性负载感性负载容性负载三相交流发电机的外部特性。电阻性负载的原理万博1manbetx图附在附件中。 约书亚·罗伯托·格鲁塔 https://la.mathworks.com/matlabcentral/profile/authors/13723188-joshua-roberto-gruta 标签:la.mathworks.com, 2005:问题/ 513136 2020 - 03 - 26 - t15:36:49z 2020 - 03 - 28 - t15:35:49z 如何提取训练过的RL代理网络的权重和偏差? 如何提取训练过的RL代理网络的权重和偏差?我的网络是:statePath = [imageInputLayer([numObservations 1 1], '正常化','none', 'Name', 'state') fullyConnectedLayer(NumNeuron, 'Name', 'CriticStateFC1') reluLayer('Name', 'CriticRelu1') fullyConnectedLayer(NumNeuron, 'Name', 'CriticStateFC2')];actionPath = [imageInputLayer([1 1 1], 'Normalization', 'none', 'Name', 'action') fullyConnectedLayer(NumNeuron, 'Name', 'CriticActionFC1') reluLayer('Name', 'ActorRelu1') fullyConnectedLayer(NumNeuron, 'Name', 'CriticActionFC2')];commonPath = [additionLayer(2,'Name', 'add') reluLayer('Name','CriticCommonRelu') fullyConnectedLayer(1, 'Name',' output')];criticNetwork = layerGraph(statePath);criticNetwork = addLayers(criticNetwork, actionPath);criticNetwork = addLayers(criticNetwork, commonPath);criticNetwork = connectLayers(criticNetwork,'CriticStateFC2','add/in1');criticNetwork = connectLayers(criticNetwork,'CriticActionFC2','add/in2');%为评论家设置一些选项criticOpts = rlRepresentationOptions('LearnRate',learing_rate,… 'GradientThreshold',1); % create the critic based on the network approximator critic = rlQValueRepresentation(criticNetwork,obsInfo,actInfo,... 'Observation',{'state'},'Action',{'action'},criticOpts); agent = rlDQNAgent(critic,agentOpts) trainingStats = train(agent,env,trainOpts); After training, I'd like to get the network's trained weights and biases. rakbar https://la.mathworks.com/matlabcentral/profile/authors/7746536-rakbar 标签:la.mathworks.com, 2005:问题/ 513587 2020 - 03 - 28 - t15:31:07z 2020 - 03 - 28 - t15:35:39z 关于快速傅里叶变换以及如何做这个运算 如何用最清晰的方式来做这个操作?请使用主要命令一步一步地展示。 奥斯曼osmanavci https://la.mathworks.com/matlabcentral/profile/authors/17830381-osman-osmanavci 标签:la.mathworks.com, 2005:问题/ 512847 2020 - 03 - 25 - t11:57:21z 2020 - 03 - 28 - t15:30:58z 如何获得培训损失的百分比? 验证精度显示在右边,但是我怎样才能得到损失精度的百分比呢?谢谢你解决了我的问题。 翁宏罗 https://la.mathworks.com/matlabcentral/profile/authors/17418219-weng-hong-loh 标签:la.mathworks.com, 2005:问题/ 513586 2020 - 03 - 28 - t15:17:53z 2020 - 03 - 28 - t15:27:41z 当我保存图像为。pdf,但matlab会产生一个A4大小的pdf,但我只需要作为图片的大小插入乳胶文档 需要帮助 Parveiz孤独的 https://la.mathworks.com/matlabcentral/profile/authors/15784408-parveiz-lone 标签:la.mathworks.com, 2005:问题/ 513582 2020 - 03 - 28 - t14:38:54z 2020 - 03 - 28 - t15:25:17z 从单元格数组中选择特定的单元格并创建单独的向量 嗨,大家好,我有以下单元格数组Max_Col_Cell(9,10,15),我想为第三个元素的所有15个值分离前两个元素(9,10)的每个组合,并创建一个有15行一列的新向量。例如,创建一个具有(1,1,:)的向量。另一个向量具有(2,1,:)等....我试图写一个循环,但它不工作。我该怎么做呢?伊利亚斯 伊利亚斯米纳斯 https://la.mathworks.com/matlabcentral/profile/authors/13907044-ilias-minas 标签:la.mathworks.com, 2005:问题/ 513515 2020 - 03 - 28 - t06:19:21z 2020 - 03 - 28 - t15:20:38z 我无法在分类器lerner应用程序中导出并行坐标并保存为JPG,也无法在导出模型中获得波型框 wavet tanu耆那教徒的 https://la.mathworks.com/matlabcentral/profile/authors/5060000-tanu-jain 标签:la.mathworks.com, 2005:问题/ 512887 2020 - 03 - 25 - t15:10:51z 2020 - 03 - 28 - t15:17:04z 循环数据采集过程100个周期 下面是一个从三轴加速度计获取数据并将数据记录到excel文件的代码。我需要帮助在循环这100个周期的代码。数据收集。getDevices daqSession = daq.createSession('ni') daqSession。addAnalogInputChannel('Dev1', 'ai0', '加速度计');daqSession。addAnalogInputChannel('Dev1', 'ai1', '加速度计');daqSession。addAnalogInputChannel('Dev1', 'ai2', '加速度计');daqSession。比率= 2048; daqSession.DurationInSeconds = 5; daqSession.Channels(1).Sensitivity = 0.010; daqSession.Channels(2).Sensitivity = 0.010; daqSession.Channels(3).Sensitivity = 0.010; [data,time] =daqSession.startForeground(); A=[data, time]; filename ='Condition-1.xlsx'; xlswrite(filename,A) daqSession.release(); delete(daqSession); clear daqSession; x=data(:,1);y=data(:,2);z=data(:,3); figure plot(time,x,time,y,time,z) title('Time domain signal') xlabel('t (seconds)') ylabel('X(t)') 赛义德 https://la.mathworks.com/matlabcentral/profile/authors/4465820-syed 标签:la.mathworks.com, 2005:问题/ 512791 2020 - 03 - 25 - t06:53:11z 2020 - 03 - 28 - t15:14:07z 在四分之一圆的圆周上描画一条弧 根据给定的问题,我必须将弧放在四分之一圆的圆周上,以最好的方式.....四分之一圆弧半径=55圆弧半径= 9圆弧角=60问题的目标是圆弧底部应接触如图所示的绿线。四分之一圆被分成缺口“a”的等截面。我们需要在每个区域以最佳的方式放置圆心,使弧以最佳的方式跟踪四分之一圆。如果需要,可以更改数据.....这个问题需要微积分来求不同圆心的最佳位置。圆弧半径=9,圆弧角=60度。(我们只需要调整所有弧线的圆心x坐标)所有弧线都是相同的,甚至方向都是相同的,弧线不能旋转。= 55/6 b1(鉴于)= 4.55 b2 = b1 + 1 * () = 4.55 + 1 * (55/6) b3 = b1 + 2 * () = 4.55 + 2 * (55/6) b4 = b1 + 3 * () = 4.55 + 3 * (55/6) b5 = b1 + 4 * () = 4.55 + 4 * (55/6) = b6 b1 + 5 * () = 4.55 + 5 * (55/6) 罗恩·赫尔曼 https://la.mathworks.com/matlabcentral/profile/authors/17932236-ron-herman 标签:la.mathworks.com, 2005:问题/ 512197 2020 - 03 - 22 - t07:46:45z 2020 - 03 - 28 - t15:13:53z 如何将一个训练好的网络分成两个网络? 我已经训练了一个u型网络,现在我想把它分成编码器和解码器,这样我就可以对编码器的输出做一些操作(例如svd和矩阵乘法),然后把调优的特征馈送到解码器。但是如何在matlab中分割训练好的网络呢?函数activations()只实现编码器部分。 克拉克陈 https://la.mathworks.com/matlabcentral/profile/authors/8163617-clark-chan 标签:la.mathworks.com, 2005:问题/ 513580 2020 - 03 - 28 - t14:35:20z 2020 - 03 - 28 - t15:12:14z 创建包含时间表的表 大家好,我正在使用树莓派和Matlab,并希望将传感器数据存储在时间表中。我想每天在一个额外的表中存储一个时间表。这张照片显示了我想怎么做。在MatLab中怎么做呢?谢谢你! 马塞尔Zehner https://la.mathworks.com/matlabcentral/profile/authors/13631197-marcel-zehner 标签:la.mathworks.com, 2005:问题/ 512842 2020 - 03 - 25 - t11:35:00z 2020 - 03 - 28 - t15:11:34z 如何从包含3个条件的列中提取特定值 你好,我遇到了在.csv文件中分离数据的问题。我有81个csv组成的巨大数据,每个文件由887808x74矩阵组成。我的工作依赖于基于条件1、条件2和条件3的第三列分离的3个条件(标签)。我想把每个条件放在一起例如,条件1和其他列中相关的所有信息放在一起等等,对于其他条件。我试着自己做,而不是工作。如果有人有想法帮助我,我会很感激。附件是文件的样本。问候, Noura AL Maghrabi https://la.mathworks.com/matlabcentral/profile/authors/16119665-noura-al-maghrabi 标签:la.mathworks.com, 2005:问题/ 303322 2016 - 09 - 16 - t16:18:44z 2020 - 03 - 28 - t15:10:39z 如何显示两个不连续的列向量 M = [2 3 4;5 6 7;我知道如何显示1:3或2:3,b = m(:,1:3),但我有困难时,试图显示只是第一和第三,更不用说当有更多的列。 米格尔·埃尔南德斯 https://la.mathworks.com/matlabcentral/profile/authors/3051271-miguel-hernandez 标签:la.mathworks.com, 2005:问题/ 513021 2020 - 03 - 26 - t03:55:15z 2020 - 03 - 28 - t15:08:24z 为什么我的GUI总是产生错误,当我运行它? 当我运行代码时,它给了我这些错误。有人能帮我解决这个问题吗?我使用的是2019年的b版本。错误Sample_2>btn_Forward_Callback(第168行)handles.Pos_X.String=num2str(floor(T(1,4));错误gui_mainfcn(第95行)feval(varargin{:});错误Sample_2(第42行)gui_mainfcn(gui_State, varargin{:});这是我的代码。Edit Rik:在函数开始时删除空函数和默认的GUIDE代码。完整的原始代码作为m文件附在附件中。function varargout = Sample_2(varargin) %standard GUIDE头,OpeningFcn和OutputFcn %——在btn_Forward中按下按钮时执行。 function btn_Forward_Callback(hObject, eventdata, handles) % hObject handle to btn_Forward (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) Th_1=str2double(handles.Theta_1.String)*pi/180; Th_2=str2double(handles.Theta_2.String)*pi/180; Th_3=str2double(handles.Theta_3.String)*pi/180; L_1=20; L_2=50; L_3=40; L(1)=Link([0 L_1 0 pi/2]); L(2)=Link([0 0 L_2 0]); L(3)=Link([0 0 L_3 0 ]); Robot=SerialLink(L); Robot.name='Sample_2'; Robot.plot([Th_1 Th_2 Th_3]); T = Robot.fkine([Th_1 Th_2 Th_3]); handles.Pos_X.String=num2str(floor(T(1,4))); handles.Pos_Y.String=num2str(floor(T(2,4))); handles.Pos_Z.String=num2str(floor(T(3,4))); % --- Executes on button press in btn_Inverse. function btn_Inverse_Callback(hObject, eventdata, handles) % hObject handle to btn_Inverse (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) PX=str2double(handles.Pos_X.String); PY=str2double(handles.Pos_Y.String); PZ=str2double(handles.Pos_Z.String); L_1=20; L_2=50; L_3=40; L(1)=Link([0 L_1 0 pi/2]); L(2)=Link([0 0 L_2 0]); L(3)=Link([0 0 L_3 0 ]); Robot=SerialLink(L); Robot.name='Sample'; T=[1 0 0 PX; 0 1 0 PY; 0 0 1 PZ; 0 0 0 1;] J=Robot.ikine(T,[0 0 0],[1 1 1 0 0 0])*180/pi; handles.Theta_1.String=num2str(floor(J(1))); handles.Theta_2.String=num2str(floor(J(2))); handles.Theta_3.String=num2str(floor(J(3))); Robot.plot(J*pi/180); KNEIVN https://la.mathworks.com/matlabcentral/profile/authors/17945584-kneivn 标签:la.mathworks.com, 2005:问题/ 382221 2018 - 02 - 12 - t15:53:57z 2020 - 03 - 28 - t15:07:15z 通过插值得到一个函数,用给定的x给出y 我有两个x和y矩阵,我可以从中画出一个图形。但我需要绘图图形来知道任意给定x的y(不仅仅是原始x),我如何建立一个函数来给出y呢?谢谢你! 拜伦赵 https://la.mathworks.com/matlabcentral/profile/authors/11617535-byron-zhao 标签:la.mathworks.com, 2005:问题/ 513585 2020 - 03 - 28 - t15:06:31z 2020 - 03 - 28 - t15:06:31z 如何使两个平面在Simscape多体垂直? 大家好,目前我正在尝试模拟后方车辆悬挂系统(半刚性轴)的行为。因为我只是在模拟一个轴,整个装配本身无法保持直线,所以我需要在不限制重要自由度的情况下,以某种方式限制它,使其不会下降。我有一个如何做到这一点的想法,但我不知道Simscape是否具有功能。在3D照片中,你可以看到一个高亮的(亮蓝色)飞机。我的想法是让这个平面垂直于地面,这样车身就可以一直保持直线,但它仍然可以划行和转弯。有没有办法让我实现这个目标? 尼古拉Vasilev https://la.mathworks.com/matlabcentral/profile/authors/13416047-nikola-vasilev 标签:la.mathworks.com, 2005:问题/ 513573 2020 - 03 - 28 - t13:30:15z 2020 - 03 - 28 - t15:02:33z 如何创建一个分布的传播数据从其平均值 我如何为下面的数据创建价差的e分布。我想在同一个图5中表示每个区域的数据从平均值开始的分布。列包含5个不同区域的每日价格。我的目的是检查不同区域之间的价格是否有显著差异。我已经尝试使用以下代码,但它没有实现我的目的。任何人都可以帮助我……x1 =数据(:1);(x2 =数据:2);x3 =数据(:,3);4 x4 =数据(:,);x5 =数据(:,5); z1=(x1-mean(x1))/std(x1); z2=(x2-mean(x2))/std(x2); z3=(x3-mean(x3))/std(x3); z4=(x4-mean(x4))/std(x4); z5=(x5-mean(x5))/std(x5); pd1=fitdist(z1,'Kernel'); pd2=fitdist(z2,'Kernel'); pd3=fitdist(z3,'Kernel'); pd4=fitdist(z4,'Kernel'); pd5=fitdist(z5,'Kernel'); s=(-2:0.01:2); y1=pdf(pd1,s); y2=pdf(pd2,s); y3=pdf(pd3,s); y4=pdf(pd4,s) y5=pdf(pd4,s);; figure p=plot(s,y1,'-b',s,y2,'k',s,y3,'-g',s,y4,':r',s,y5,'-m'); title('Empirical kernel') gjashta https://la.mathworks.com/matlabcentral/profile/authors/12107468-gjashta 标签:la.mathworks.com, 2005:问题/ 512704 2020 - 03 - 24 - t18:18:47z 2020 - 03 - 28 - t15:01:54z 如何绘制多个迭代对数图。 N0 = 1*10.^9;N = 3;T = 365 * 24 * 3600;Table = cell(n, 4);T = logspace(1,7);A = logspace(-22,-1);ylabel(活动/ s ^。');包含(' t ');set(gca,'xscale','log') L(1) = 4.979*10.^-18;L(2) = 3.329*10.^-7; L(3) = 2.874*10.^-5; for i=2:n Bsum=0; for t = 1:1*10.^5:T Prod1 = 1; for l = 1:i-1 Prod1 = Prod1*L(l); end for j = 1:i Prod2 = 1; for k = 1:i t if k ~= j Prod2 = Prod2*(L(k) - L(j)); end end Sum = Ssum+exp(-L(j)*t)/Prod2; end F = Sum*Prod1*N0; A = Sum*L(i); Table(i, :) = {i t F A }; fprintf('%d %d %d %d\n', Table{i, :, :}); end end My Scipt needs to output graphs for each iteration of i in terms of A against t, at the moment it will do it to i=3 but if I need to more I would like it to automatically plot the graphs like the subplot command. Currently my code for my graph only outptus the whole of the iteration from 1:3 rather than each iteration Activity = logspace(-22,-1); loglog(A,t,'-o') line(A, t) Any help will be great! 亚历克斯•曼努埃尔• https://la.mathworks.com/matlabcentral/profile/authors/13884336-alex-manuel 标签:la.mathworks.com, 2005:问题/ 513575 2020 - 03 - 28 - t14:12:51z 2020 - 03 - 28 - t15:01:05z 球坐标变为笛卡尔坐标 我在一个3D图中绘制天线图案,其中两个轴代表theta和phi坐标。现在我想改变绘图,以便能够在xyz坐标系中有真正的3D绘图,我尝试使用sph2cart函数,但我得到了奇怪的结果。有人能帮帮我吗?Surf (phi0rad*180/pi,theta0rad*180/pi,(abs(rho.')) colorbar xlabel('\phi') ylabel('\theta') shading interp %% [az, el]=meshgrid(phi0rad*180/pi, theta0rad*180/pi);[x, y, z] = sph2cart (az, el, rho_2。');冲浪(x,y,z)我还附上了我试图获得的图片。谢谢。 马特奥菲 https://la.mathworks.com/matlabcentral/profile/authors/17541118-matteo-fe 标签:la.mathworks.com, 2005:问题/ 512963 2020 - 03 - 25 - t20:50:34z 2020 - 03 - 28 - t15:00:48z 用特定数字填充兰德矩阵 晚上好,假设我有一个=兰特(1500,1000),我需要用1填充1:300的数字,300:600用0.75,900:1200用0.5等等。然后以图片的形式展示。我感觉被这个卡住了:/ Deividas Silgalis https://la.mathworks.com/matlabcentral/profile/authors/14571754-deividas-silgalis 标签:la.mathworks.com, 2005:问题/ 513467 2020 - 03 - 27 - t21:03:59z 2020 - 03 - 28 - t14:56:40z 如何在向量中提取数字 我有一个向量a=[1:88]我想知道有多少数字是8,比如8,18,28 ..等等,这是代码x=[1:88] y=字符串(x) z=包含(y,'8'),它似乎工作得不好,然后我会手动执行。我想知道我错过了什么? Marwan Abduljawad https://la.mathworks.com/matlabcentral/profile/authors/4524493-marwan-abduljawad 标签:la.mathworks.com, 2005:问题/ 513519 2020 - 03 - 28 - t07:14:00z 2020 - 03 - 28 - t14:55:15z 如何在向量中自动添加值大于某一边界值的元素的值? 我不知道如何自动地给向量加值。但是我有两个y向量的聚类。它们是y小于10的元素和y大于10的元素。这是集群代码yrendah=sum(y(:) <= 10);Ytinggi =sum(y(:) > 10);在我的算法中,在我找到'sx'的值之后,我将更新'y'的值。其中,“y”中每个大于10的元素将被加到“sx”的值中。对于元素“y”,其值小于10,则不会发生变化。我如何将每个“y”元素的值与“sx”相加超过10 ?这是完整的代码,clc; clear all; T=readtable('EVASUSANTIDATA.xlsx'); x1=T.PENDAFTARAN; x2=T.TUNDA; x3=T.KUOTA; y=T.LAMA; yn=length(y); yrendah=sum(y(:) <= 10); ytinggi=sum(y(:) > 10); for i=1:yn if y(i)<=10 c=x3(i); while y(i)<=10 c=c-1; y(i)=(x1(i)+x2(i))/(c); end if y(i)>=10 y(i)=(x1(i)+x2(i))/(c+1); end d=c+1; k(i)=x3(i)-d; end end sx=round(sum(k)/ytinggi); sxx=rem(sum(k),ytinggi); 艾迪Iswardi https://la.mathworks.com/matlabcentral/profile/authors/16292322-eddy-iswardi 标签:la.mathworks.com, 2005:问题/ 443598 2019 - 02 - 06 - t23:23:20z 2020 - 03 - 28 - t14:51:48z 为什么没有情节?3行代码中有6个错误。 我在做一个更大的项目,它不会绘图,给了我一堆错误,这些错误甚至不是我代码的一部分。我尝试了一个简单的代码,看看它是否会绘图,但我得到了相同的错误。我已经关闭并重新加载MatLab,它仍然错误。X = [1 2 3 4 5];Y = [1 2 3 4 5];上面是绘图代码,下面是错误。未定义的函数'claNotify'用于输入参数类型为'matlab.graphics.axis.Axes'。cla(第42行)中的错误claNotify(ax,extra{:});newplot>ObserveAxesNextPlot(第152行)错误cla(ax, 'reset', hsave);newplot(第93行)中的错误ax = observveaxesnextplot (ax, hsave); Error in matlab.graphics.internal.newplotwrapper (line 12) axReturn = newplot(varargin{:}); Error in Untitled (line 3) plot(x,y) I'm running MATLAB R2018b - academic use. Thanks for any suggestions. Josh旷课乐 https://la.mathworks.com/matlabcentral/profile/authors/11955195-josh-crunk 标签:la.mathworks.com, 2005:问题/ 513463 2020 - 03 - 27 - t20:27:42z 2020 - 03 - 28 - t14:51:14z 从for循环中提取数据 我想用t = 9时的Tskin减去t = 10时的Tskin。我怎么做呢?T = 29;% %C温度= 20;% C Tfilm = (T + Tambient)/2;for t = 1:1:100 k_air_2 = (2.4131 + 0.0078 * t) * 10^-2;% W/m*C rho_air = 1.2893 - 0.004 * Tfilm;% kg/m^3 mu_air = (0.0047 * Tfilm + 1.7164) * 10^-5;% kg/m*s k_air_ambient= (2.4131 + 0.0078 * Tfilm) * 10^-2;% W/m*C Re =直径_前臂* V * rho_air / mu_air; h_air = (k_air_ambient/Diameter_forearm) .* (0.3 + ((0.62 * Re.^.5 * Pr.^.333)/((1 + (0.4 * Pr).^.667).^.25)).*(1 + ((Re/282000).^(5/8))).^.8) % J/s*K*m^2 Uskin = (k_air_2/thickness_air) + (k_cotton/thickness_shirt) + (h_air) % J/s*K*m^2 Uambient = (k_air_ambient/thickness_air) + (k_cotton/thickness_shirt) + (h_air) Tskin = [(T * Area * Cp_air * rho_air)/(t-(t-1)) + Qgen + (Uambient * Area * Tambient)]/((Area * Cp_air * rho_air / ((t-(t-1)))) + Uskin * Area); T = Tskin Tfilm = (T + Tambient)/2 fprintf('Y is %.2f C after %d seconds ' ,Tskin,t) end 贾斯汀海耶斯 https://la.mathworks.com/matlabcentral/profile/authors/9592112-justin-hayes 标签:la.mathworks.com, 2005:问题/ 512891 2020 - 03 - 25 - t15:24:19z 2020 - 03 - 28 - t14:50:43z 从ode传递额外的输出参数 我有以下代码在模拟ode后获得[t,x]。除了解之外,我还想得到下式中的函数值F(x,t)。%从odes x0 =初始值的系统中获取动态;Tspan = 0:0.0001:0.5;Options = odeset('abstol', 1e-10, 'reltol', 1e-9);%生成解[t, x] = ode15s(@(t,x) fun(t,x), tspan, x0,options);%获取函数值,f, from ode [dy f] = fun([], []) function [dy f] = fun(t,x) persistent f f = [] A = %矩阵dy = A*x if nargout >1 f = horzcat(f, A*x) end end在代码中,我已经定义了一个持久化变量f,用于存储我求解器所采取的每个时间步骤的f。我接收f使用' [dy f] = fun([],[]) ' '但f和x的大小不相等,因为根据我的理解,x的输出仅在tspan中定义的时间点给出(我猜在插值后)。而f在求解器内部的时间t中被保存。总之,我的问题是,如何在得到x的同一时刻得到f。 Deepa Maheshvare https://la.mathworks.com/matlabcentral/profile/authors/8575091-deepa-maheshvare 标签:la.mathworks.com, 2005:问题/ 513570 2020 - 03 - 28 - t13:18:49z 2020 - 03 - 28 - t14:46:35z 索引超过数组元素数 大家好,我知道有几个类似的问题,但我没有找到我的问题的答案。我试图用简单的csvread函数从.csv文件加载数据。csv。文件(见附件)应该包含222.490个值。Pos_x = csvread('C:\Users\Niels\谷歌Drive\position.csv', 1,1);然而,我得到以下错误:'索引超过数组元素的数量(0)。'在matlab中创建一个大小为300.000x1的矩阵本身是没有问题的,所以我不确定问题是什么,有什么建议吗?提前谢谢! 尼尔斯·德·弗里斯 https://la.mathworks.com/matlabcentral/profile/authors/8799263-niels-de-vries 标签:la.mathworks.com, 2005:问题/ 513584 2020 - 03 - 28 - t14:42:39z 2020 - 03 - 28 - t14:42:39z SARIMA季节调整 嗨,我正在研究加州每月的降水。我的目标是通过查看ACF和PACF来找出哪种SARIMA模型是最好的。但在那之前,我得考虑季节性因素。在进行adf测试后,该系列是平稳的。我看过其他人是怎么做的,但他们都不是平稳级数。所以我不认为这里描述的方法是有效的?https://se.mathworks.com/help/econ/nonseasonal-and-seasonal-differencing.html有什么帮助吗? 穆罕默德·哈利勒 https://la.mathworks.com/matlabcentral/profile/authors/17373853-mohammed-khalil 标签:la.mathworks.com, 2005:问题/ 513571 2020 - 03 - 28 - t13:19:34z 2020 - 03 - 28 - t14:41:58z 如何通过随机选择数据集在多个数据集之间使用自举技术 我有两个215,000个样本的时间序列,一个是E,另一个是H;我将总样本分为10个部分,即E时间序列的每个部分21,500个样本,H时间序列的10个部分,即每个部分21,500个样本,我想计算Z=[E/H];E和H数据存储在一个部分的一个矩阵中,即10个部分总共10个矩阵。现在从10个中随机选择一个部分(矩阵),概率相等,即1/10,这个过程重复10次。这将产生10个部分(或矩阵)。需要注意的是,其中有些部分可能是相同的部分,因为每个部分都是从整个采样空间中以相等的概率独立选择的。然后将所选10个矩阵对应的E和H数据项应用于方程Z=[E/H],得到阻抗Z1的一个估估值。整个过程重复500次,使Z1,Z2的500个估计....得到Z500。通过自举得到的平均值被认为是Z估计,95%的置信区间由标准差得出。如何做到这一点。 Please anybody help me to solve this.? Pradeep Bukke https://la.mathworks.com/matlabcentral/profile/authors/2661294-pradeep-bukke 标签:la.mathworks.com, 2005:问题/ 513572 2020 - 03 - 28 - t13:28:12z 2020 - 03 - 28 - t14:36:10z 在数组之外使用符号数组的条目 我通过X=sym(X,[8,24])定义了一个符号变量矩阵;例如,当我现在输入x5_24时,MATLAB仍然显示“未识别的函数或变量x5_24”。为什么?我需要用到矩阵X之外的变量项。 托拜厄斯Ohrmann https://la.mathworks.com/matlabcentral/profile/authors/15783938-tobias-ohrmann 标签:la.mathworks.com, 2005:问题/ 151461 2014 - 08 - 19 - t09:42:55z 2020 - 03 - 28 - t14:34:42z 瑞利衰落信道中如何设置多普勒频移、采样时间、路径延迟、路径增益 例如:Ts = 1e-4;%采样周期(s) fd = 100;最大多普勒频移%路径延迟和增益tau = [0.1 1.2 2.3 6.2 11.3]*Ts;PdB = linspace(0, -10, length(tau)) - length(tau)/20;h = rayleighchan(Ts, fd,tau,PdB),其中Ts,fd,tau,PdB的值是如何分配的 SIVASANKARI https://la.mathworks.com/matlabcentral/profile/authors/5485541-sivasankari 标签:la.mathworks.com, 2005:问题/ 511832 2020 - 03 - 19 - t21:55:10z 2020 - 03 - 28 - t14:34:34z 如何绘制无影响锥(COI)信号的CWT 默认的cwt()函数用虚线标记COI绘制小波变换。我要消去这条直线。我怎么做呢?我发现这个答案很有用。但是生成的cwt图像与默认的cwt()函数不一样。生成的两张图片附在这里。 Achintha Ihalage https://la.mathworks.com/matlabcentral/profile/authors/16661924-achintha-ihalage 标签:la.mathworks.com, 2005:问题/ 513579 2020 - 03 - 28 - t14:25:08z 2020 - 03 - 28 - t14:34:16z 神经网络训练- X和Y的观察数量不一致 我创建了一个随机周期和振幅的正弦波组合数据库,并在每个正弦波中添加随机噪声,从而创建一组“干净”数据和“有噪声”数据,并希望训练一个简单的前馈网络来去噪噪声信号。我的训练数据,噪声信号在一个301x10000双数组中,其中每一列对应一个波,301是时间的长度,10000是随机信号的数量。干净的信号是完全相同的格式,301x10000双阵列。数组中的第一个清洁信号对应训练数据中的第一个噪声信号,即训练数据集中的第一个噪声信号是第一个清洁信号的噪声版本。我的网络结构简单,一个图像输入层,3个具有tanh激活的全连接层和一个回归输出。我知道我需要使用重塑函数来重塑数据,但我不确定如何-我不明白的是,为什么它说训练数据和目标数据中的观察数量不一致,当它们都是相同的维度时?本质上:trainingData是一个301x10000双噪声正弦波阵列trainingTargets是一个301x1000双阵列的相同正弦波,但没有噪声想象输入层的维度为[1 301]当使用trainNetwork函数馈入网络时,我得到X和Y的观测值不一致 Tajwar Choudhury https://la.mathworks.com/matlabcentral/profile/authors/12751750-tajwar-choudhury 标签:la.mathworks.com, 2005:问题/ 513516 2020 - 03 - 28 - t07:06:09z 2020 - 03 - 28 - t14:33:31z 如何从有许多子文件夹目录的文件夹读取图像 我需要从固定文件夹中的许多子文件夹中读取图像,以便在循环中对图像进行进一步处理。为了更好地理解,这里给出了流程图。我的matlab代码和datasetImage文件夹在同一个文件夹。我需要在每个子文件夹中读取image .tif图像。值得注意的是,有一些文件夹丢失了,比如IM005。如果有人能帮我阅读***. tif文件以便进一步处理,那就太有帮助了。提前谢谢你。 riya shahrin https://la.mathworks.com/matlabcentral/profile/authors/15983192-riya-shahrin 标签:la.mathworks.com, 2005:问题/ 513046 2020 - 03 - 26 - t08:06:05z 2020 - 03 - 28 - t14:31:00z 反向传播输出的图混淆 你好,我试图绘制所有的混乱矩阵,我可以看到每个类的准确性,如https://uk.mathworks.com/help/deeplearning/ref/plotconfusion.html所示,不幸的是,我得到常数错误开关表达式必须是一个标量或字符向量。代码低于%预处理%加载数据Tb = readtable('train1.csv',' preservvariablenames ',true);Tbv = readtable('test1.csv',' preservvariablenames ',true);%合并两个数据集,然后通过动态%参数Tbt = union(Tb, Tbv) %拆分为train target TrainSet = Tbt(:,(1:562))%data.simplefitInputs';TargetSet = Tbt(:,(563:563));%data.simplefitTargets';TargetSet= table2array(TargetSet) %make some noise TrainSetArray = table2array(TrainSet) noisessignal = cos(5 * pi * 100 * TrainSetArray)+√(5)* randn(size(TrainSetArray));%TRAINING x = TrainSetArray';%x =噪声信号';t = TargetSet';%t = categorical(Tb(:,(563:563))); failed DURING TRAINING trainFcn = 'trainlm'; % Levenberg-Marquardt backpropagation. % Create a Fitting Network hiddenLayerSize = 10; net = fitnet(hiddenLayerSize,trainFcn); % Create a Fitting Network hiddenLayerSize = 1; net = fitnet(hiddenLayerSize,trainFcn); % Setup Division of Data for Training, Validation, Testing net.divideParam.trainRatio = 70/100; net.divideParam.valRatio = 15/100; net.divideParam.testRatio = 15/100; % Train the Network [net,tr] = train(net,x,t); %get output y = net(x); %get test set testX = x(:,tr.testInd); testT = t(:,tr.testInd); testY = net(testX); %PLOTTING CONFUSION MATRIXacorss classes as % https://uk.mathworks.com/help/deeplearning/ref/plotconfusion.html YPredicted = classify(net.myNet,testX)%Line Causing error SWITCH expression must be a scalar or a character vector. plotconfusion(testy,YPredicted) 托马斯Kaczmarski https://la.mathworks.com/matlabcentral/profile/authors/17173063-tomasz-kaczmarski 标签:la.mathworks.com, 2005:问题/ 513574 2020 - 03 - 28 - t13:31:44z 2020 - 03 - 28 - t14:23:06z 混淆矩阵,敏感性和特异性 我有实际的Y和预测的Y矩阵27×1双类型。我写了下面的代码,但它不工作。请问我哪里错了?[cm,order] = confusimat (actual_Y,predicted_Y);%如果yHat是你的预测,yval是你的y为真,那么tp = sum((predicted_Y == 1) & (actual_Y == 1)) fp = sum((predicted_Y == 1) & (actual_Y == 0) tn = sum((predicted_Y == 0) & (actual_Y == 1) fn = sum((predicted_Y == 0) & (actual_Y == 0))敏感性= tp/(tp + fn) %TPR特异性= tn/(tn +fp) %TNR精度= tp/(tp +fp) FPR = fp/(tn+fp);精度= (TP+TN)./(TP+FP+TN+FN);召回率= tp / (tp + fn) F1 =(2 *精度*召回率)/(精度+召回率); 巴希尔萨巴 https://la.mathworks.com/matlabcentral/profile/authors/15700746-saba-bashir 标签:la.mathworks.com, 2005:问题/ 513577 2020 - 03 - 28 - t14:22:14z 2020 - 03 - 28 - t14:22:14z 模糊控制问题:(1)输出1(2)输入1没有触发规则,期望值在[-1]范围内,但值为700。 在“UPQC_fuzzy_1/FuzPID/Fuzzy/Fuzzy Logic Controller”中,输入1期望在[-1 1]范围内的值,但其值为700。[341相似]组件:Simulink |类别:块万博1manbetx警告在“UPQC_fuzzy_1/FuzPID/Fuzzy/Fuzzy逻辑控制器”中,没有为输出1触发规则。去模糊化输出值设置为其平均范围值0。[723 similar]组件:Simulink万博1manbetx |类别:块警告“UPQC_fuzzy_1/锁相环/模型/自动增益控制/正序列(锁相环驱动)/平均(变频)1/模型/可变传输延迟”的指定缓冲区太小。在模拟过程中,缓冲区大小临时增加到22528。为了生成代码,你需要更新缓冲区大小参数[3 similar]组件:Simulink |类别:块警告BTW,模拟非常慢,可能与大量警告有关。万博1manbetx有人能帮帮我吗?非常感谢!邮箱:213162941@seu.edu.cn shichen史 https://la.mathworks.com/matlabcentral/profile/authors/9230016-shichen-shi 标签:la.mathworks.com, 2005:问题/ 328623 2017 - 03 - 07 - t20:32:16z 2020 - 03 - 28 - t14:18:12z Matlab许可证激活问题 我的笔记本电脑坏了。现在我有了一个新的。我想在新的笔记本电脑上安装Matlab,但是被告知我需要在损坏的笔记本电脑上禁用许可证,这是我做不到的。请帮我解决这个问题。谢谢。 林之浩 https://la.mathworks.com/matlabcentral/profile/authors/1399112-zhihao-lin