How to add to values of a field?
5 views (last 30 days)
Show older comments
How can I add values to a field without overwriting the previous entry? In a for loop
0 Comments
Answers (1)
Cris LaPierre
on 29 May 2020
Edited: Cris LaPierre
on 29 May 2020
Use your loop counter variable to specify where to add the value.
By field do you mean in a structure?
for a = 1:3
b.field1(a) = val;
end
3 Comments
See Also
Categories
Find more on Logical 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!