seperating digits as a separate element

Let say we have a variable A=[34 56], i want to write it as A=[3 4 5 6] that is to make each digit of a number a separate variable, how can I do this in MATLAB.

 채택된 답변

Walter Roberson
Walter Roberson 2011년 3월 20일

0 개 추천

sprintf('%d',A) - '0'

댓글 수: 1

Zain ul Aabidin
Zain ul Aabidin 2011년 3월 20일
Thanks Sir..this is what I am looking for. But can you tell me how this command is working.I mean what is actually happening in this command?

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

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by