Multiply two cells of an table.
3 次查看(过去 30 天)
显示 更早的评论
采纳的回答
Voss
2022-5-21
EM_Volllastkurve = table([0;100;200;300],[550;550;550;550],'VariableNames',{'Drehzahl' 'Drehmoment'})
To multiply (row 1, column 1) by (row 1, column 2):
EM_Volllastkurve{1,1}*EM_Volllastkurve{1,2}
% or
EM_Volllastkurve{1,'Drehzahl'}*EM_Volllastkurve{1,'Drehmoment'}
to do the same for all rows of the table:
EM_Volllastkurve{:,1}.*EM_Volllastkurve{:,2}
% or
EM_Volllastkurve{:,'Drehzahl'}.*EM_Volllastkurve{:,'Drehmoment'}
4 个评论
Voss
2022-5-21
Well, they are saved in the EM_Volllastkurve table already, and here's a plot of Leistung vs Drehzahl:
EM_Volllastkurve = table((0:100:1100).',550*ones(12,1),'VariableNames',{'Drehzahl' 'Drehmoment'});
EM_Volllastkurve.Leistung = EM_Volllastkurve.Drehmoment.*EM_Volllastkurve.Drehzahl*2*3141/60000;
plot(EM_Volllastkurve.Drehzahl,EM_Volllastkurve.Leistung)
xlabel('Drehzahl')
ylabel('Leistung')
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!