getting the error :Error using ' Transpose on ND array is not defined.:', in the following codelines..pls help.

조회 수: 3 (최근 30일)
fprintf(f, 'P5\n%d\n%d\n255\n', cols, rows); fwrite(f, img', 'uint8');

채택된 답변

Roger Stafford
Roger Stafford 2013년 9월 1일
Apparently the array img has more than two dimensions, so writing its transpose is not well-defined. I would guess its third dimension represents its three colors, red, green, and blue.
Whereas a two-dimensional array has only one other way to rearrange its two dimensions, a three-dimensional array, for example, has five other ways. The matlab command for doing this is appropriately called 'permute', there being as many ways of arranging n dimensions as there are permutations on the numbers from 1 to n. You will have to decide just what it is you wish to happen to the dimensions of img in your fwrite command.
  댓글 수: 1
Rochan Patel
Rochan Patel 2013년 9월 3일
thank you brother its working...can u also tell me what is the meaning of < tmp.pgm >tmp.key , in the statement, command = [command ' < tmp.pgm >tmp.key'].. Thank you :)

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by