필터 지우기
필터 지우기

How do I print a cell array to txt or convert it to a matrix???

조회 수: 4 (최근 30일)
Ashraf Afana
Ashraf Afana 2013년 5월 29일
I have the following array
val(:,:,1) = [145][2.0101e-09] [-6] [1x1 cfit] [1x1 struct] [0.5170]
... ... ...
val(:,:,100) =[144][6.0301e-09][0][1x1 cfit] [1x1 struct][0.6009]
How can I print this array to txt file or convert it to a matrix???
Thanks
  댓글 수: 2
Jan
Jan 2013년 5월 29일
I cannot imagine, what the code should mean. Could you please valid Matlab syntax? "[1x1 struct]" needs to be specifically explained, before it can be answered, how it can be written to a file.
Ashraf Afana
Ashraf Afana 2013년 5월 30일
Hi,
The original array of 100 values (resulted from a script) has the following structure: '<1x1 struct>' '<1x1 struct>' ... '<1x1 struct>'. Each value within the array has the following field names (omm ommt ose f gof rauc)and their values are (([145][2.0101e-09] [-6] [1x1 cfit] [1x1 struct] [0.5170])).
The values of the fourth comes from a fit of gaussin and the fifth are their parameters, which is another struct with the following fields(( sse, rsquare dfe, adjrsquare, rmse)) with their corresponding values. I tried fprintf and cellarray, struct2cell and struct2mat but I always have an error massage. So, how to print and extract this nested structure array?

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

채택된 답변

Brent
Brent 2013년 5월 29일
If your structures are numerical you can use the RESHAPE function with a third dimension of 1.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by