Evaluating and storing in vector

2 Ansichten (letzte 30 Tage)
Abdul Rauf Anwar
Abdul Rauf Anwar am 17 Nov. 2014
Beantwortet: the cyclist am 17 Nov. 2014
The solution might be easy but i cant figure out, please take a look at this line of code
eval(['cPDC' num2str(j) num2str(k) '=pdc(j,k,:)']);
assuming j=1 and k=2 (arbitrary), so for time being I am saving something (vector or matrix) in variable cPDC12=.. how can I change this line to save in vector, something like cPDC12(:,i)=.., where i is loop variable. Any help or suggestion will be greatly appreciated.

Antworten (1)

the cyclist
the cyclist am 17 Nov. 2014
I expect you could do this without using eval at all. Read this Q/A for a better way to do this.

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by