Filter löschen
Filter löschen

How to assign variable to matrix positions

2 Ansichten (letzte 30 Tage)
Tejas Sabu
Tejas Sabu am 3 Jun. 2020
Kommentiert: Walter Roberson am 17 Aug. 2020
Given matrix A , assign the second coloumn of A to a varible v.
A = [1:5; 6:10; 11:15; 16:20];
i tried using the syms command but failed
and also the value it stores for v is 118, thats whats comming if a i try to assign it
  3 Kommentare
Walter Roberson
Walter Roberson am 17 Aug. 2020
I do not understand what syms has to do with this question??
Walter Roberson
Walter Roberson am 17 Aug. 2020
Is the idea that you are trying to create an "alias" for the second column of A, named v, such that if you were to assign to v(3) then A(3,2) would also change?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

madhan ravi
madhan ravi am 3 Jun. 2020
v = sym(A(:,2))

Kategorien

Mehr zu Matrices and Arrays 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