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 Kommentare

VBBV
VBBV am 29 Sep. 2020
Bearbeitet: per isakson am 29 Sep. 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];
x = fivex2matrix(:,1);
y = fivex2matrix(:,2);

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Steven Lord
Steven Lord am 29 Sep. 2020

0 Stimmen

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.)

Kategorien

Gefragt:

am 29 Sep. 2020

Beantwortet:

am 29 Sep. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by