필터 지우기
필터 지우기

Always Error is seen

조회 수: 33 (최근 30일)
Monaco
Monaco 2024년 7월 27일 15:57
답변: Walter Roberson 2024년 8월 7일 6:01
It always tells me that Z is not matrix
  댓글 수: 2
dpb
dpb 2024년 7월 27일 16:18
Well then, it must not be.
How are we supposed to do anything from that cryptic statement alone???
Abhaya
Abhaya 2024년 8월 7일 5:31
There might be a problem with variable name. Try to delete the workspace and run the program again.

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

답변 (1개)

Walter Roberson
Walter Roberson 2024년 8월 7일 6:01
Most likely, you are using surf() or contour() and the complaint is that Z is not at least a 2 x 2 matrix.
The most common cause for this problem is if you have vectors of x, y, and z, and try to surf() or contour() the vectors . If you have vectors x y and z, then you need to use scatteredInterpolant to produce a gridded Z to plot.
The second most common cause of this problem is if you have vectors x and y that are the same size and orientation and use them to calculate z... getting out a vector z. If you want to calculate for each independent pair of x and y, you need to make sure that the vectors are different orientation, such as x(:).^2 - 2.*y(:).'
The third most common cause of this problem is if you accidentally use the / operation where you need the ./ operation

카테고리

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

태그

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by