Lets say I have a table of 5 columns in my workspace.
I want each of the variables A, B, C, D to be assinged to a single column.
For exaple A = Column 1, B=Column 3 etc.
I know I can write A = Table( : ,1), but is there a way to do it all at once instead of individually?

 채택된 답변

Matt J
Matt J 2021년 4월 5일
편집: Matt J 2021년 4월 5일

1 개 추천

for i=1:4, Q{i}=Table{:,i}; end
[A,B,C,D]=deal(Q{:})

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기

제품

릴리스

R2020b

질문:

2021년 4월 5일

댓글:

2021년 4월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by