Silly question about 2 column matrix
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
It is my understanding that
a = [1 3 5; 2 4 6; 7 8 10]
yet
AL01-SIGMA09 = [1183.885678 512.1;
568.8329716 512.1;
417.7853247 512.1;
200.7327245 512.1;
38.95699064 512.1;
19.83313269 512.1;
14.56665171 512.1;
8.010756815 512.1]
gives me this error, I can't see the difference. Can someone explain how I create a two column matrix from this data.
Thanks in advance
Alex
0 Commenti
Risposta accettata
Tushar
il 6 Giu 2023
Hello A Poyser,
Please note that the error you are getting is not due to the "=" or "==" operator but it is simply because you cannot use hyphens in variable naming in MATLAB. Change the variable name and you can create the matrix using the very same syntax you provided :) Instead try using underscore.
AL01_SIGMA09 = [1183.885678 512.1;
568.8329716 512.1;
417.7853247 512.1;
200.7327245 512.1;
38.95699064 512.1;
19.83313269 512.1;
14.56665171 512.1;
8.010756815 512.1]
2 Commenti
John D'Errico
il 6 Giu 2023
In fact, really this answer gets to the correct point of the problem best. Sadly, it was not accepted as the correct answer. That is a flaw of Answers. But at least I can give it an up-vote. Such is life.
Più risposte (1)
VBBV
il 6 Giu 2023
Modificato: VBBV
il 6 Giu 2023
From the below error, its visible that AL01 & SIGMA09 are both scalar variables and difference between them is also scalar. They have different dimensions when compared with matrix present in RHS & not possible to equate them
AL01 = 3;
SIGMA09 = 2;
AL01-SIGMA09 = [1183.885678 512.1;
568.8329716 512.1;
417.7853247 512.1;
200.7327245 512.1;
38.95699064 512.1;
19.83313269 512.1;
14.56665171 512.1;
8.010756815 512.1]
Vedere anche
Categorie
Scopri di più su Matrix Indexing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!