필터 지우기
필터 지우기

Create power map of motor using xlxread ie Speed Torque and Power

조회 수: 25 (최근 30일)
rockstar49
rockstar49 2023년 8월 9일
답변: Divyanshu 2023년 8월 21일
Hi,
where it is a speed torque graph with power instead of effeciencies. Im trying to pull data from an excel file with a colum for speed, torque and input power.
Im using this but im not sure how to generate the map using contourf(XYZ)
[Data]=xlsread('Table.xlsx');
X=[Data(:,11)]; (Speed)
Y=[Data(:,2)]; (Torque)
Z=[Data(:,50)]; (Power)
Contourf(X,Y,Z);
etc.
Can someone show me the best way to do this? I think i need to create (x,y) before i use the contour function.
Thanks
  댓글 수: 1
dpb
dpb 2023년 8월 9일
"...show me the best way to do this?"
readtable, in all likelihood; xlsread has been deprecated for quite a while, now...
Once you have the table, use the references to the desired columns by name from it; don't make more copies of the same data.
Specific help would doubtless ensue if you would attach the input file so folks can see what actually have and do something with it.

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

답변 (1개)

Divyanshu
Divyanshu 2023년 8월 21일
Hi rockstar49,
Here are few assumptions I have made based on the description provided:
  • The data contains three values probably as columns in the excel sheet i.e., speed, torque & power.
  • And you want to plot power on a X-Y grid where X is speed and Y is torque.
Few steps you can follow to achieve the desired plot are:
  • Firstly, read the data from the excel-file using readtable” function.
  • Then, create a 2-D grid of speed & torque using “meshgrid” function of Matlab.
  • Finally, you can plot the data using “contourf” function.
Here is a sample Matlab script you can refer to:
data = readtable("Book1.xlsx");
[speed,torque] = meshgrid(data.S,data.T);
power = data.S * data.T'
contourf(speed,torque,power)
In the above script, "power" is a 9 * 9 matrix which we got by multiplying each element of "speed" with all the elements of "torque".
Please refer the following documentation for further understanding of the functions used:

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by