Error using surf (line 71) Data dimensions must agree.. How to rectify this error.

tspan = [t_sr t_ss];
y=zeros(2,m);
y0 = [T_amb(1); T_amb(1)];
[t,y] = ode15s(@(t,y) odefcn(t,y,T_amb), tspan, y0);
figure
plot(t,y(:,1),'o',t,y(:,2),'+')
ylabel('temperature(oC)');
xlabel('time in decimal(s)');
Tp=y(:,2);
t1 =linspace(20580,59520,5);
r=linspace(0.0005,0.01,5);
ul = Tp(1);
ur = Tp(48);
m =1;
sol = pdepe(m,@pdex1pde,@pdex1ic,@pdex1bc,t1,r);
T = sol(:,:,1);
surf(r,t,T)
title('Numerical solution computed with 20 mesh points')
xlabel('Radius r')
ylabel('Time t')

回答(1 个)

There are too many missing parts to run the posted code.
See if this works —
surf(t,r,T)
.

类别

在 帮助中心 和 File Exchange 中查找有关 Guidance, Navigation, and Control (GNC) 的更多信息

产品

版本

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by