Frustrating matlab is.
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
5x2matrix=[2 4;7 9;12 14;17 19;22 24]
x=[2;7;12;17;22]
y=[4;9;14;19;24]
% output equation: w=(10x^2)-13xy-(3y^2)
Problem: Using the values in the first column of the 5x2 matrix for x and the values in the second column of the 5x2 matrix for y. The output table should display x in the first column, y in the second column, and w in the third column.
I need help with how to assign the output equation to w using the 5x2matrix for the x and y values, and idk how to put all that info into one table. Thanks.
2 comentarios
VBBV
el 29 de Sept. de 2020
Editada: per isakson
el 29 de Sept. de 2020
x=[2;7;12;17;22]
y=[4;9;14;19;24]
% output equation: w=(10x^2)-13xy-(3y^2)
w=(10*x.^2)-13*x.*y-(3*y.^2);
T = [x y w];
Respuestas (1)
Steven Lord
el 29 de Sept. de 2020
Others have given you the answer. This problem involves just basic indexing in MATLAB, so I'm guessing you're relatively new to MATLAB (or haven't used MATLAB for a while.) If that is correct you may find the free MATLAB Onramp tutorial useful if you haven't already taken it. It teaches the basics of how to work with MATLAB. Some of the sections cover exactly the skills you needed to solve this problem (particularly sections 5 and 6.)
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!