Can I assign one element of a vector to a variable?

4 Ansichten (letzte 30 Tage)
Jonathan Babitsch
Jonathan Babitsch am 14 Mai 2020
Kommentiert: Ameer Hamza am 14 Mai 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:
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.
Thank you very much for your help in advance, I'm a beginner at Matlab so thanks a lot everybody.
Johnny

Akzeptierte Antwort

Ameer Hamza
Ameer Hamza am 14 Mai 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 Kommentare
Jonathan Babitsch
Jonathan Babitsch am 14 Mai 2020
It´s not you are right, even though I´m doing it for a company where we are building a simulation together with Catia and the CFD. However one iteration takes like 18 seconds, which are peanuts compared to what the CFD is gonna take so I guess we are just fine. Thanks a lot for your advice Ameer, I will do some research there.
Once again thanks for your overall help, wouldn`t have made it without your advice today.
Ameer Hamza
Ameer Hamza am 14 Mai 2020
I am glad to be of help!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by