Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have calculated the outputs for a polynomial that I want to insert into the co

ID: 3655715 • Letter: I

Question

I have calculated the outputs for a polynomial that I want to insert into the column of a matrix. I have 3 polynomials and want my matrix size to be n * 3. How do i set the first outputs to the first column and then repeat for the other two polynomials. So I want outputs from 000 to 222 for sum to be in the first column such as matrix [sum1 sum2 sum3]. I dont only want the final answer rather the answers for each step so the output for 000 and 001 etc. How do i first assign the sum1 to column 1 and then add two more sums after to combine everything into one matrix. My current code is clear all;clc; a=3; b=4;c=5; for x=0:2 for y=0:2 for z=0:2 sum1=(a*x)+(b*y)+(c*z); str=sprintf('f(%d,%d,%d)=%d',x,y,z,sum1); disp(str); end end end

Explanation / Answer

%closest I can figure from your comments clear all;clc; a=3; b=4;c=5; count=1; for x=0:2 for y=0:2 for z=0:2 sum(count,1)=(a*x)+(b*y)+(c*z); sum(count,2)=(3*a*x)+ (2*b*y)+(4*c*z); sum(count,3)=(2*a*x)+ (3*b*y)+(4*c*z); count=count+1; end end end

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote