3d-plot regarding 2 vectors and a matrix

Hey guys,
i cant seem to figure this one out. So i have a 25 by 25 matrix with Torque values ranging from 0 to about 300 from a data set. Then i have 2 vectors with 25 values regarding a current Iq and a current Id, ranging from 0 to 600. Now i want to plot the current values in the x and y axis and the resulting torque in z. I have tried using the plot3 function but i cant get it going.
Any help would be deeply appreciated

댓글 수: 3

Jan
Jan 2022년 2월 6일
편집: Jan 2022년 2월 6일
"I have tried using the plot3 function but i cant get it going."
Please post your code an the error message or explain the difference between the results and your needs. Then it is much easier to post a matching answer.
Waht is a "current lq and ld"?
Iq = [0, 25, 50, 75, 100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375, 400, 425, 450, 475, 500, 525, 550, 575, 600];
Id = [0, 25, 50, 75, 100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375, 400, 425, 450, 475, 500, 525, 550, 575, 600];
Te = data{1,3}.Trq;
surf(Iq,Id,Te)
colorbar
thats the code so far. Iq and Id a currents which induce a magnetic flux in a stator from a permanent magnet synchronous machine. And the magnetic flux results in an electromagnetic Torque in the rotor. But that is no so relevant because i already have the resulting torque based from the currents Iq and Id stored in a matrix data{1,3}. With data{1,3}.Trq being a 25x25 matrix.I have tried transposing the vector Id, but it didnt help.
Error in surf (line 145)
hh = matlab.graphics.chart.primitive.Surface(allargs{:});
Error in Test (line 36)
surf(Id,Iq,Te)

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

답변 (1개)

KSSV
KSSV 2022년 2월 6일

1 개 추천

Read about surf.
Let Iq, Id be your vectors of size 1x25 and T be your torque matrix of size 25x25.
surf(Iq,Id,T)
colorbar

댓글 수: 6

Iq = [0, 25, 50, 75, 100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375, 400, 425, 450, 475, 500, 525, 550, 575, 600];
Id = [0, 25, 50, 75, 100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375, 400, 425, 450, 475, 500, 525, 550, 575, 600];
Te = data{1,3}.Trq;
surf(Iq,Id,Te)
colorbar
thats the code so far. Iq and Id a currents which induce a magnetic flux in a stator from a permanent magnet synchronous machine. And the magnetic flux results in an electromagnetic Torque in the rotor. But that is no so relevant because i already have the resulting torque based from the currents Iq and Id stored in a matrix data{1,3}. With data{1,3}.Trq being a 25x25 matrix.I have tried transposing the vector Id, but it didnt help.
error code: Error in surf (line 145)
hh = matlab.graphics.chart.primitive.Surface(allargs{:});
Error in Test (line 36)
surf(Id,Iq,Te)
If your Te is 25x25 matrix. It should not throw any error.
Iq = [0, 25, 50, 75, 100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375, 400, 425, 450, 475, 500, 525, 550, 575, 600];
Id = [0, 25, 50, 75, 100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375, 400, 425, 450, 475, 500, 525, 550, 575, 600];
Te = rand(25) ; % dummy data for demo
surf(Iq,Id,Te)
To recity the error. I suggest you to atach your data.
Okay, i have found the problem. The data sheet for the resulting Torque had an entry like 8.55e04, which was interpreted like a name and therefore could not be plotted. Thank you for your help.
KSSV
KSSV 2022년 2월 7일
Perfect.....thanks is accepting/ voting the answer.. :)
Jan
Jan 2022년 2월 8일
Some years ago we had some troubles with a user, who was too eager to earn points. Before this episode I've voted frequently for all answers, which contains working code or useful ideas. After seeing, how aggressive the chase for points can become, I reduced my voting. I do see a problem in the addiction potential of positive feedback in social media.
I did vote for your answer, although the terms "accepting" and "voting" occur in the comments, because your are obvioulsy stable and experienced.

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

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2022년 2월 6일

댓글:

Jan
2022년 2월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by