Azzera filtri
Azzera filtri

how to nest cell array

3 visualizzazioni (ultimi 30 giorni)
david Pham
david Pham il 1 Lug 2018
Risposto: Sri Harish G il 2 Lug 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 Commenti
david Pham
david Pham il 1 Lug 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 il 1 Lug 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.

Accedi per commentare.

Risposte (1)

Sri Harish G
Sri Harish G il 2 Lug 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'

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by