Info

This question is closed. Reopen it to edit or answer.

Using Variable to Assess a Struct

1 view (last 30 days)
Adam
Adam on 18 Jun 2014
Closed: MATLAB Answer Bot on 20 Aug 2021
I'm trying to have this statement pass me the length of the '..._matlabout(1,%i)' Structure Array by utilizing a variable so I can have the script perform the task on multiple documents. The structure array and individual value are mapped to variables 'b' and 'c' The problem I have is that the "length(b)" calculation returns the length of characters in "test_%i_out_matlabout(1,%i).data" instead of the actual length of the numerical array.
Does anyone know how to solve this issue? The same somewhat applies to the use of the variable 'c' as well in that I am trying to compare the array value instead of the string value of 'c'.
Thanks!
for z=1:2
b = sprintf('test_%i_out_matlabout(1,%i).data',i1,z);
for i=1:length(b)
c = sprintf('test_%i_out_matlabout(1,%i).data(%d)',i1,z,i);
if (c >= 3550)
c = 5550;
end

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!