Mathematical functions across variables
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have two variables saved in the workspace, A and B. Say A is 3x3 and B is 2x2. This seems so simple, but how would I add A(1,1) to B(2,1)? I can't seem to get anything to work. Thanks.
1 Kommentar
Stephen23
am 19 Sep. 2023
"This seems so simple, but how would I add A(1,1) to B(2,1)? I can't seem to get anything to work"
Antworten (2)
John D'Errico
am 18 Sep. 2023
Bearbeitet: John D'Errico
am 18 Sep. 2023
Is there a good reason why you would not just try this?
A(1,1) + B(2,1)
I think you are coming from a spreadsheet world. And for some reason you think MATLAB needs to operate just like a spreadsheet. Honestly, I don't know what it is you would have tried to do that operation. But I will guess you were trying to click on those elements somehow, and get an addition.
0 Kommentare
the cyclist
am 18 Sep. 2023
Bearbeitet: the cyclist
am 18 Sep. 2023
If you just want to know their sum
A(1,1) + B(2,1)
If you want to add A(1,1) to the value stored in B(2,1)
B(2,1) = A(1,1) + B(2,1)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Spreadsheets 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!