matlab :打印不显示e,打开多个figure保存,打开文件框,与C语言代码不一致 | 您所在的位置:网站首页 › matlab结果带e › matlab :打印不显示e,打开多个figure保存,打开文件框,与C语言代码不一致 |
1.直接打印数字,没有e,或者使用%f,打印带有小数点的。 disp(num2str(Fk,'%f'))画线: line([1,10],[1,1]); 画一条y=1,x=1:10的线 在图上做标注: text(x(p),y(p),['(',num2str(x(p)),',',num2str(y(p)),')'],'color','r'); 2.将打开的多个figure保存jpg格式到同一个文件下 for i=1:11 print(i,'-djpeg',['D:\Users\Desktop\picture\',num2str(i),'.jpg']); end3.matlab打开文件对话框 [filename, pathname] = uigetfile('*.*', '选择数据文件','MultiSelect', 'on'); %选择文件 if isequal(filename,0) %判断是否选择 msgbox('没有选择任何数据文件'); return; else pathfile=fullfile(pathname, filename); %获得数据路径 {1} end4. matlab程序与C语言不一致的原因,若不是因为代码没有写对的话,就要考虑数据类型的问题,matlab默认都是浮点型,对于int型,需要强制转化,采用fix:向0取整的方法。 5,画图 颜色 r 红 g 绿 b 蓝 c 蓝绿 m 紫红 y 黄 k 黑 w 白 -实线 :虚线 -. 点画线 - - 双画线 标记符 点形 + 加号 o 圆圈 * 星号 . 实心点 x 叉号 s 正方形 d 钻石形 ^ 上三角形 v 下三角形 > 右三角形 < 左三角形 p 五角星形 h 六角星形 plot(X,Y,S) where S is a character string made from one element from any or all the following 3 columns: b blue . point - solid g green o circle : dotted r red x x-mark -. dashdot c cyan + plus -- dashed m magenta * star (none) no line y yellow s square k black d diamond w white v triangle (down) ^ triangle (up) < triangle (left) > triangle (right) p pentagram h hexagram实心的圆圈:plot(index + tmax - 20, max_value,'.','Markersize',15);
|
CopyRight 2018-2019 实验室设备网 版权所有 |