필터 지우기
필터 지우기

Data plot for different values

조회 수: 1 (최근 30일)
University Glasgow
University Glasgow 2022년 9월 14일
편집: Torsten 2022년 9월 14일
I want plot theta as a function of z at t = time(nt) for all xi values but receive: Error using plot: Data cannot have more than 2 dimensions om line 140.

채택된 답변

Torsten
Torsten 2022년 9월 14일
%store your outputs for each xi
thetaxivalues(ixi,:,:) = theta(:,:);
vxivalues(ixi,:,:) = v(:,:);
What is ixi ? I guess, it's a single scalar, namely ixi = nxi from the last loop where ixi appears:
for ixi = 1:length(xivalues)
xi = xivalues(ixi);
end
So you don't store outputs for each xi.
  댓글 수: 8
University Glasgow
University Glasgow 2022년 9월 14일
If you cehck the discretised equations, I have xi in the v equation.
Please check, you will see: (xi/(2*h))*(theta(N-1)-theta(N-3));
Torsten
Torsten 2022년 9월 14일
편집: Torsten 2022년 9월 14일
Then call the solver in a loop over the elements of xi and write the results in a 3d v and theta array.
But that's really standard and I won't do that for you.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by