Borrar filtros
Borrar filtros

how to nest cell array

3 visualizaciones (últimos 30 días)
david Pham
david Pham el 1 de Jul. de 2018
Respondida: Sri Harish G el 2 de Jul. de 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 comentarios
david Pham
david Pham el 1 de Jul. de 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 el 1 de Jul. de 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.

Iniciar sesión para comentar.

Respuestas (1)

Sri Harish G
Sri Harish G el 2 de Jul. de 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'

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by