Plot 4D function with respect to two variables and a parameter
이전 댓글 표시
There is a differential equation
. I would like to change the value of parameter value of A from
to
and plot C against
and Aas shown in the picture below.
. I would like to change the value of parameter value of A from
and plot C against 
I tried it in MATLAB as follows:
DY3 = {};
PARAMA = linspace(-0.067,0.067,20);%parameter A
for i=1:numel(PARAMA)
param.A = PARAMA(i);
otherparams;%m file that contains other parameters
Tend = 200;
Nt = 100;
RHS = @(t,x) func(t,x,param,1);
%Execution-----------------------------------------------------------------
x0 = [0.001,0.004,0.006]; %Initial condition
t = linspace(0,Tend,Nt); %TSPAN
options = odeset('RelTol',1e-4,'AbsTol',1e-4);
sol = ode45(RHS, t, x0, options);
[y,yp] = deval(sol,t);
x1 = y(1,:);
x2 = y(2,:);
dy3 = yp(3,:);%evaluate derivative
DY3{i} = dy3;
end
M = cell2mat(DY3);
[X1,X2,PARAMA] = meshgrid(x1,x2,PARAMA);
[faces,verts] = isosurface(x1,x2,PARAMA,M,0);
Whe I run this code I get the following error message.
Error using isosurface (line 79)
V must be a 3D array.
Can someone please help me to resolve this? Thank you very much!
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!