Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

How to Access These Values of This Struc without Using a For Loop?

1 Ansicht (letzte 30 Tage)
Rightia Rollmann
Rightia Rollmann am 13 Mär. 2017
Geschlossen: Stephen23 am 13 Mär. 2017
Here’s my initial struct:
A(1).B.C = 'a';
A(2).B.C = 'b';
A(3).B.C = 'a';
A(4).B.C = 'a';
I want to change the values of C based on values of Values and indexes of IndexingArray:
Values = {'a', 'b'}
IndexingArray = [1 1 0 1];
So, my struct will be:
A(1).B.C = 'b';
A(2).B.C = 'b';
A(3).B.C = 'a';
A(4).B.C = 'b';
Isn’t really there a way to do it without using a for loop?

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by