Saving a matrix into a file, saving 2 dimensional plots
    1 回表示 (過去 30 日間)
  
       古いコメントを表示
    
Hi,
Through my matlab program, I'm generating several matrices. I would like to save the matrices into a .m file. Is this possible?
The reason I say .m file because I would liek o see the matrices in the same format as that when they appear in the command window after typing
disp(my_matrix)
How to store the matrices in .m (or any other preferred) file?
2) Secondly, I'm generating several two dimensional plots through my matlab program. How do I save these plots?
0 件のコメント
回答 (2 件)
  Azzi Abdelmalek
      
      
 2015 年 8 月 5 日
        A=[1  2;3 4]
save filename A  % use load filename to get the matrix A
To save a figure, use saveas or hgsave
2 件のコメント
  Azzi Abdelmalek
      
      
 2015 年 8 月 6 日
				I don't know why this is happening to you. There is another way to save your plots
h=plot(1:10) % Example
hgsave(h,'filename')
To get your plot
hgload('filename')
  Walter Roberson
      
      
 2015 年 8 月 6 日
        The format you need to use to enter matrices in .m files is not compatible with the format that is output by disp()
You should look at the -ASCII flag of save(), and you should look at mat2str()
0 件のコメント
参考
カテゴリ
				Help Center および File Exchange で Printing and Saving についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


