Filter löschen
Filter löschen

Multiplying two columns in a matrix

36 Ansichten (letzte 30 Tage)
itzhak mal
itzhak mal am 30 Jan. 2019
Kommentiert: Walter Roberson am 30 Jan. 2019
Hi
I have loaded a text file into a matrix using dlmread function. this has 17 columns.. and now i want to add another column that is the multyplication of the 17th column and the 15th column. how do I do so?
thank you!!

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 30 Jan. 2019
YourArray(:,end+1) = YourData(:,15) .* YourData(:,17);
  2 Kommentare
itzhak mal
itzhak mal am 30 Jan. 2019
When I used dlm read it went into a matrix you named here "YourArray" right? So what's the difference between the "YourData" and the matrix? How do I solve this?
Thank you so much!!
Walter Roberson
Walter Roberson am 30 Jan. 2019
TheNameOfYourArrayGoesRightHere(:,end+1) = TheNameOfYourArrayGoesRightHere(:,15) .* TheNameOfYourArrayGoesRightHere(:,17);

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by