필터 지우기
필터 지우기

how to nest cell array

조회 수: 3 (최근 30일)
david Pham
david Pham 2018년 7월 1일
답변: Sri Harish G 2018년 7월 2일
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
david Pham
david Pham 2018년 7월 1일
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 2018년 7월 1일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Sri Harish G
Sri Harish G 2018년 7월 2일
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'

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by