フィルターのクリア

matrix file output problem?

3 ビュー (過去 30 日間)
jim
jim 2014 年 10 月 19 日
コメント済み: jim 2014 年 10 月 21 日
when i run my code it give the answers start with Y= ... and give the matrix output divided in column (Columns 1 through 14,Columns 15 through 28 and so on) i want the answer to be a matrix file without Y= or columns divided to parts. how to do this? (my output file is txt file) help needed
  8 件のコメント
Hikaru
Hikaru 2014 年 10 月 20 日
I don't really know why, but you are right, y' gives the correct output. And I tested it using your matrix M, I didn't see the mirrored bit.. my output is attached, is it not the same as y?
fileID = fopen('output.txt','w')
fprintf(fileID,'%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\r\n',y');
fclose(fileID);
jim
jim 2014 年 10 月 20 日
yes its right now,,, i try it again and it runs without mirror..maybe i was mistaking before. thanks a lot man ... i try to vote for you but i couldn't find the link thanks

サインインしてコメントする。

採用された回答

Jan
Jan 2014 年 10 月 19 日
編集済み: Jan 2014 年 10 月 20 日
What about using fprintf to write to the command window?
[EDITED]
What about:
fmt = [repmat('%d ', 1, 31), '%d\r\n'];
fileID = fopen('output.txt','w')
fprintf(fileID, fmt, flipud(y'));
fclose(fileID);
  1 件のコメント
jim
jim 2014 年 10 月 21 日
thanks it works fine.....

サインインしてコメントする。

その他の回答 (1 件)

MatlabFan
MatlabFan 2014 年 10 月 19 日
I suggest that you rephrase your question, and be more specific about what exactly it is that you are trying to achieve. I don't have any idea of what you need help on, because your question is not well posed. Please, pose your question in a way that gives clear details as to what you want to accomplish; and I'm sure you will get very satisfactory answers, and in a quick turnaround time too.
  2 件のコメント
jim
jim 2014 年 10 月 19 日
i added two matrix (50*30) and the result (Y= X+Z) was divided in column (Columns 1 through 14,Columns 15 through 28 and so on) started with Y= . I want the result to be pure matrix.without Y= i want the column to be all together without division. 1111000111000110011100101001; 0001100010011110011011100100;
Jan
Jan 2014 年 10 月 19 日
The output is a pure matrix.
I cannot understand, how tzhe addition of two [50 x 30] matrices can create a [2 x 28] matrix.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by