Filter löschen
Filter löschen

how to nest cell array

3 Ansichten (letzte 30 Tage)
david Pham
david Pham am 1 Jul. 2018
Beantwortet: Sri Harish G am 2 Jul. 2018
i have a 1x36 cell array how do i make it so that if i were to click on the 1x36 cell array each of the 36 values in the row would be a 1x1 cell. Also the "values" are names of units for example "psi" so they are all text no numbers.
im looking to keep the 1x36 cell array and all the 36 1x1 cells
  3 Kommentare
david Pham
david Pham am 1 Jul. 2018
in my workspace "A" is a 1x36 cell array, the values are just units like psi, velocity, density and so on for 36 columns.
i want it so that once i click on the 1x36 cell array in my workspace itll show a 1x1 cell for psi and all the other 36 units.
Jan
Jan am 1 Jul. 2018
It does not get clearer. What does "the values are just units like psi, velocity, density" mean? Using valid Matlab syntax is preferred in this forum. I guess:
A = {'psi', 'velocity', 'density'}
What are "names of units". The "workspace" is the list of the variables in the currently running function. Do you mean the "workspace browser"? What does "show a 1x1 cell for psi" mean? Where should be shown what?
Please try to describe your problem more clearly.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Sri Harish G
Sri Harish G am 2 Jul. 2018
If you want to store each of the units in a separate cell you could define your variable as
A={{'psi} {'velocity'} {'density'}};
This way when accessing A{1}
>>A{1}
ans =
1X1 cell array
{'psi'}
>>A{1}{1}
ans =
'psi'

Kategorien

Mehr zu Characters and Strings finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by