//www.tianjin-qmedu.com/matlabcentral/answers/questions?term=answered_by_id%3A165035 MATLAB的答案——新问题匹配answered_by_id: 165035 2023 - 05 - 09 - t08:31:09z 标签:www.tianjin-qmedu.com, 2005:问题/ 1959864 2023 - 05 - 08 - t17:32:02z 2023 - 05 - 09 - t08:31:09z 我怎么能限制一个参数(湍流强度),只有积极的价值观? 你好,我有一个代码,参数u3表示湍流强度振荡由正转负为每个迭代。因为消极的动荡没有任何物理意义,我于是想限制只有积极的价值观是相同的。我发现很难限制相同的代码。谁能指引我请对上述。请使用callme运行。m文件。关于,钢筋混凝土 拉胡尔 //www.tianjin-qmedu.com/matlabcentral/profile/authors/28962299 标签:www.tianjin-qmedu.com, 2005:问题/ 1943334 2023 - 04 - 07 - t12:56:17z 2023 - 04 - 14 - t08:57:40z 修复后负载与Savitzky-Golay加速度信号滤波器 嗨我有附加代码处理加速度数据和savitzky-Golay过滤器适用于另一篇文章但是post-load数据是不正确的,因为它向下倾斜,应遵循橙线。橙色的线是准确的从线性位移测量,我试图匹配使用瞬间集成加速度如下照片中可以看到。我的代码也一并附呈。谢谢你!清楚,clc;表= [“Sheet1”、“Sheet2”,“Sheet3”,“Sheet4”,“Sheet5”,“Sheet6”,“Sheet7”,“Sheet8”,“Sheet9”);为测试= 1:9% %设置导入选项和导入数据选择= spreadsheetImportOptions (" NumVariables ", 1);%指定表和选择范围。表=表(测试);选择。DataRange = " C2: C246”; % Specify column names and types opts.VariableNames = "VarName3"; opts.VariableTypes = "double"; % Import the data tbl = readtable("C:\Users\Emily\LVDTData.xls", opts, "UseExcel", false); %% Convert to output type LDVT(:,test) = (59-(tbl.VarName3)); %% Clear temporary variables clear opts tbl end clear test Sheets fsL = 8.2; tL = 0:(1/fsL):(length(LDVT(:,1))-1)/fsL; tL = tL+5.06; %% Now to unpack the JA and Kistler %% Set up the Import Options and import the data opts = delimitedTextImportOptions("NumVariables", 4, "Encoding", "UTF-8"); % Specify range and delimiter opts.DataLines = [5, Inf]; opts.Delimiter = ","; % Specify column names and types opts.VariableNames = ["Timestamp", "VarName2", "Timestamp1", "VarName4"]; opts.VariableTypes = ["double", "double", "double", "double"]; % Specify file level properties opts.ExtraColumnsRule = "ignore"; opts.EmptyLineRule = "read"; % Import the data tbl = readtable("C:\Users\Emily\Accelerations.csv", opts); %% Convert to output type tAcc = tbl.Timestamp; KistlerWhole = tbl.VarName2; JAWhole = tbl.VarName4; fsA = 2048; %% Clear temporary variables clear opts tbl AccStart = [ 65 ; 315; 655; 780; 990; 1399; 1502; 1600; 1844]; AccEnd = [ 105 ; 355; 695; 820; 1030; 1439; 1542; 1640; 1884]; for test = 1 : 9 [~,a] = min(abs(tAcc-AccStart(test))); [~,b] = min(abs(tAcc-AccEnd(test))); JA(:,test) = JAWhole(a:b); Kistler(:,test) = KistlerWhole(a:b); % JA(:,test) = detrend(JA(:,test)); % Kistler(:,test) = detrend(Kistler(:,test)); tA(:,test) = tAcc(a:b); tA(:,test) = tA(:,test) -( tA(1,test) ); end clear KistlerWhole JAWhole tAcc AccStart AccEnd test a b workspace; % Make sure the workspace panel is showing. format long g; format compact; hFig1 = figure; tA = tA(:,9); JA = JA(:,9); plot(tA, JA, 'b.-', 'MarkerSize', 1); grid on; hold on; fontSize = 20; xlabel('Time', 'FontSize', fontSize); ylabel('Acceleration', 'FontSize', fontSize); title('Original Signal', 'FontSize', fontSize); hFig1.WindowState = 'maximized'; % Maximize the figure window. % Draw a line at y=0 yline(0, 'LineWidth', 2); % A moving trend is influenced by the huge outliers, so get rid of those first. % Find outliers outlierIndexes = isoutlier(JA); plot(tA(outlierIndexes), JA(outlierIndexes), 'ro', 'MarkerSize', 15); % Extract the good data. tGood = tA(~outlierIndexes); accelGood = JA(~outlierIndexes); % plot(t(~outlierIndexes), accel(~outlierIndexes), 'mo', 'MarkerSize', 10); % Plot circles around the good data. % Do a Savitzky-Golay filter (moving quadratic). windowWidth = 51; % Smaller for tighter following of original data, bigger for smoother curve. smoothedy = sgolayfilt(accelGood, 2, windowWidth); hold on; plot(tGood, smoothedy, 'r-', 'LineWidth', 2); %legend('Original Signal', 'X axis', 'Outliers', 'Smoothed Signal'); % fill in the missing points. smoothedy = interp1(tGood, smoothedy, tA); % Now subtract the smoothed signal to get the variation signal = JA - smoothedy; % Plot it. hFig2 = figure; plot(tA, signal, 'b.-', 'MarkerSize', 9); grid on; hold on; title('Corrected Signal', 'FontSize', fontSize); xlabel('Time', 'FontSize', fontSize); ylabel('Acceleration', 'FontSize', fontSize); hFig2.Units = 'normalized'; hFig2.Position = [.2, .2, .5, .5]; % Size the figure window. % Draw a line at y=0 yline(0, 'LineWidth', 2); VelCor = cumtrapz(tA,signal); DispCorr = cumtrapz(tA,VelCor); DispCorr = DispCorr*10^4; figure(); clf; hold on subplot(1,1,1); plot(tA, DispCorr, 'b');hold on plot(tL,LDVT(:,9));hold off grid on; hold on; title('Corrected Displacement', 'FontSize', fontSize); xlabel('Time', 'FontSize', fontSize); ylabel('Displacement', 'FontSize', fontSize); hFig2.Units = 'normalized'; hFig2.Position = [.2, .2, .5, .5]; % Size the figure window. % Draw a line at y=0 艾米丽的钥匙 //www.tianjin-qmedu.com/matlabcentral/profile/authors/25457480 标签:www.tianjin-qmedu.com, 2005:问题/ 511876 2020 - 03 - 20 - t06:45:49z 2020 - 03 - 23 - t22:12:33z 问题为mathlab西珥模型 mathlab你好,我很新,我想测试西珥模型但我不能让它跑了。我有问题当我试着运行代码。我使用这个github库来计算它。从fileexchange https://la.mathworks.com/matlabcentral/fileexchange/74545-generalized-seir-epidemic-model-fitting-and-computation https://github.com/ECheynet/SEIR和这个文件我尝试运行示例3的所有文件(在github),但当我运行它的输出:错误使用SEIQRDP太多的输入参数。错误的青年们(38)行(年代,E, I, Q, R, D, P] = SEIQRDP(α1,beta1γdelta1,λ₁,Kappa1, Npop, E0,钱数,Q0, R0, D0, t);我把下面的示例3文件,也许你可以帮我找到这个问题吗?它可能是非常简单的…示例3文件。clearvars;关闭所有clc;负载(‘DATA.mat’,‘tableRecovered’,‘tableDeaths’,‘tableConfirmed’,‘时间’)indLocation =找到(包含(tableRecovered.CountryRegion,“意大利”)= = 1)tableRecovered (indLocation, 1:2) indLocation = indLocation(1)恢复= table2array (tableRecovered (indLocation, 5:结束)); Deaths = table2array(tableDeaths(indLocation,5:end)); Confirmed = table2array(tableConfirmed(indLocation,5:end)); % If the number of confirmed Confirmed cases is small, it is difficult to know whether % the quarantine has been rigorously applied or not. In addition, this % suggests that the number of infectious is much larger than the number of % confirmed cases minNum= 40; Recovered(Confirmed<=minNum)=[]; Deaths(Confirmed<=minNum)=[]; time(Confirmed<=minNum)= []; Confirmed(Confirmed<=minNum)=[]; Npop= 120e6; % population guess = [0.06,1.2,1/5,1/40,0.01,0.02,0.01,0.02]; % my guess for the fit E0 = Confirmed(1); % Initial number of exposed cases (we do not know it, so it is set at zero) I0 = Confirmed(1); % Initial number of infectious cases (we do not know it, so it is the number of quarantined) Q0 = Confirmed(1); R0 = Recovered(1); D0 = Deaths(1); [alpha1,beta1,gamma1,delta1,Lambda1,Kappa1] = ... fit_SEIQRDP(Confirmed-Recovered-Deaths,Recovered,Deaths,Npop,E0,I0,time,guess); dt = 0.1; % time step time1 = datetime(time(1)):dt:datetime(2020,3,25,0,0,0); N = numel(time1); t = [0:N-1].*dt; [S,E,I,Q,R,D,P] = SEIQRDP(alpha1,beta1,gamma1,delta1,Lambda1,Kappa1,Npop,E0,I0,Q0,R0,D0,t); figure semilogy(time1,Q,'r',time1,R,'b',time1,D,'k'); hold on semilogy(time,Confirmed-Recovered-Deaths,'ro',time,Recovered,'bo',time,Deaths,'ko'); % ylim([0,1.1*Npop]) ylabel('Number of cases') xlabel('time (days)') % leg = {'susceptible','exposed','infectious','quarantined','recovered','Dead','insusceptible'}; leg = {'Quarantined (confirmed infectious)','recovered','Dead'}; legend(leg{:},'location','southoutside') set(gcf,'color','w') grid on axis tight % ylim([1,8e4]) set(gca,'yscale','lin') Jacobo白菜 //www.tianjin-qmedu.com/matlabcentral/profile/authors/17874033