Problem with eval and char(13)

2 views (last 30 days)
Alain
Alain on 21 Oct 2013
Answered: Alain on 22 Oct 2013
Hello
My problem :
chaine = b.BeamSequence.Item_1.BeamDescription with 1 change every loop
chainefinale = 'DM=1.3692
SEG=2' with a char(13) inside (before SEG)
the eval ([chaine '=' chainefinale]) return error.....
What can i do ?
Thanks
Alain

Answers (2)

Walter Roberson
Walter Roberson on 21 Oct 2013
Don't use eval.
itemnumber = 1;
b.BeamSequence.(sprintf('Item_%d', itemnumber)).BeamDescription = chainefinale;

Alain
Alain on 22 Oct 2013
Thank ! Best regard Alain

Categories

Find more on Function Creation in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!