Can I assign one element of a vector to a variable?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Jonathan Babitsch
il 14 Mag 2020
Commentato: Ameer Hamza
il 14 Mag 2020
Hi everybody,
I have a question concerning my recent work. Isn't it possible to assign one element of a vector to a variable and get that saved in a cell array in a loop?
Later on I want to find the biggest element out of these and work with it. This is the error:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/292892/image.png)
I also uploaded my code, as you can see the failure occures in line 219.
Here is a quick screenshot of the part of the code in case you don't need the full code.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/292893/image.png)
Thank you very much for your help in advance, I'm a beginner at Matlab so thanks a lot everybody.
Johnny
0 Commenti
Risposta accettata
Ameer Hamza
il 14 Mag 2020
verschyl{allepunkte} is a row vector, whereas you are accessing it as a column vector. Reverse the order to correct the error. See the attached file. It should run without error.
10 Commenti
Più risposte (0)
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!