I have error when try to plot 3D for hyperbolic equation

조회 수: 1 (최근 30일)
lulu
lulu 2021년 1월 22일
편집: Deepak Meena 2021년 1월 26일
hello every one , I have a model with u_t+u_x=0, the code is working but when I tried to plot it as 3d I got error. Please I want to understand the problem and solve it. thank you.
I attached my file.
  댓글 수: 1
Athrey Ranjith Krishnanunni
Athrey Ranjith Krishnanunni 2021년 1월 23일
First of all, your file does not have a valid MATLAB script name because it has spaces and parantheses in it. I removed them, but please rename it or you won't be able to run it.
Further, you have defined X and T as
X=linspace(0,0.001,1);
T=linspace(0,0.1,500);
when you probably want
X = 0:0.001:1;
T = 0:0.1:500;
or
X = linspace(0,1,1001);
T = linspace(0,500,5001);
Also, you had an error in the 3D plot function surf because your third input (ur) is supposed to vary over both the first (X) and the second inputs (T), and therefore necessarily need to be a 2-D matrix. In your case, ur seems to only vary with X.

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

답변 (1개)

Deepak Meena
Deepak Meena 2021년 1월 26일
편집: Deepak Meena 2021년 1월 26일
Hi Iman,
As the ARK mentioned in the comment, the file does not have valid MATLAB script name.I tried to run the code I am getting the following error:
Error using conturningRE (line 15)
mu should<1.0!
Also, for the communtity members it is difficult to debug large code ,so It would be helpful for us if you specify where you are having trouble and what error are you getting.
Let us know what error you are having.
Thanks

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by