matlab调用jmathplot的jar方法
来源:互联网 发布:云计算的资源类型 编辑:程序博客网 时间:2024/06/10 22:55
下面是编写的jplot.m
function cmdtest=jplot(data,varargin)
% Usage: jplot.<sh|bat> <-2D|-3D> [-l <INVISIBLE|NORTH|SOUTH|EAST|WEST>]
% [options] <ASCII file (n rows, m columns)> [[options] other ASCII
% file][-l <INVISIBLE|NORTH|SOUTH|EAST|WEST>] giving the legend
% position[options] are:
% -t <SCATTER|LINE|BAR|HISTOGRAM2D(<integer h>)|HISTOGRAM3D(<integer h>,
% <integer k>)|GRID3D|CLOUD2D(<integer h>,<integer k>)|CLOUD3D(
% <integer h>,<integer k>,<integer l>)> type of the plot
% SCATTER|LINE|BAR: each line of the ASCII file contains coordinates
% of one point.
% HISTOGRAM2D(<integer h>): ASCII file contains the 1D sample (i.e.
% m=1) to split in h slices.
% HISTOGRAM3D(<integer h>,<integer k>): ASCII file contains the 2D
% sample (i.e. m=2) to split in h*k slices (h slices on X axis and k
% slices on Y axis).
% GRID3D: ASCII file is a matrix, first row gives n X grid values,
% first column gives m Y grid values, other values are Z values.
% CLOUD2D(<integer h>,<integer k>): ASCII file contains the 2D sample
% (i.e. m=2) to split in h*k slices (h slices on X axis and k slices
% on Y axis), density of cloud corresponds to frequency of X-Y slice
% in given 2D sample.
% CLOUD3D(<integer h>,<integer k>,<integer l>): ASCII file contains
% the 3D sample (i.e. m=3) to split in h*k*l slices (h slices on X
% axis, k slices on Y axis, l slices on Y axis), density of cloud
% corresponds to frequency of X-Y-Z slice in given 3D sample.
% -n name name of the plot
% -v <ASCII file (n,3|2)> vector data to add to the plot
% -q<X|Y|Z>(<float Q>) <ASCII file (n,1)> Q-quantile to add to the
% plot on <X|Y|Z> axis. Each line of the given ASCII file contains the
% value of quantile for probvability Q.
% -qP<X|Y|Z> <ASCII file (n,p)> p-quantiles density to add to the plot
% on <X|Y|Z> axis. Each line of the given ASCII file contains p values.
% -qN<X|Y|Z> <ASCII file (n,1)> Gaussian density to add to the plot on
% <X|Y|Z> axis. Each line of the given ASCII file contains a
% standard deviation.
% Sqniu 09/24/09
% Modified:
% $Revision:0.1 $Date: 2009/09/24 11:05:56 $
%--------------------------------------------------------------------------
if nargin < 1
error('MATLAB:jplot:Nargin','Requires at least 1 input arguments.');
end
[row,col]=size(data);
if col==2
basestr='java -cp jmathplot.jar org.math.plot.PlotPanel -2D -l SOUTH ';
elseif col==3
basestr='java -cp jmathplot.jar org.math.plot.PlotPanel -3D -l SOUTH ';
else
error('MATLAB:jplot:data',' The matrix with two columns or three columns.');
end
filetemp=['jplot','.txt'];
disp(varargin)
if length(varargin)<1
dlmwrite(filetemp,data,'delimiter',' ','newline','pc');
runstr=[basestr,filetemp];
elseif length(varargin)>=1
varargin=strcat(' ',varargin);
drawflag=cell2mat(varargin);
dlmwrite(filetemp,data,'delimiter',' ','newline','pc');
runstr=[basestr,drawflag,' ',filetemp];
else
error('MATLAB:jplot:varargin','Input arguments is not right.');
end
disp(runstr)
cmdtest=dos(runstr);
delete(filetemp);
end
>>jplot(rand(10,2),'-t line',' -n data')
![](http://www.ilovematlab.cn/attachments/month_0909/20090924_1e3d9c63b4754797a783CKZoxF91u8Vn.jpg)
>>jplot(rand(10,3),'-t bar',' -n data')
![](http://www.ilovematlab.cn/attachments/month_0909/20090924_3e8e1156e450d1720462rOS6ucEffjBt.jpg)
>>jplot(rand(10,3))
![](http://www.ilovematlab.cn/attachments/month_0909/20090924_238548c34cd24c9a5255Zo7x64nQb9eo.jpg)
需要的资源jmathplot.jar 该jar包已经上传 须将该文件下载改名为jmathplot.jar即可用。将jar和上面的jplot.m文件放在同一个文件夹下,并将运行路径置于该文件夹路径。然后可以按照上图所示例子在matlab命令窗口调用,也可在其他m文件中调用。jplot.m的调用接口已经规范化为matlab的格式。
- matlab调用jmathplot的jar方法
- java调用matlab生成的jar
- php调用java的jar包方法
- 可运行jar调用第三方jar的方法
- matlab中调用函数的另一种方法 @
- MATLAB调用C/C++函数的方法
- MATLAB调用C/C++函数的方法
- MATLAB调用C/C++函数的方法
- MATLAB调用C/C++函数的方法
- VC6.0调用Matlab Dll的方法
- MATLAB调用C/C++函数的方法
- MATLAB调用C/C++函数的方法
- MATLAB调用C/C++函数的方法
- MATLAB调用C/C++函数的方法
- MATLAB调用C/C++函数的方法
- C语言调用matlab文件的方法
- MATLAB调用C/C++函数的方法
- Matlab通过mex调用CUDA的方法
- C#单向循环列表 解决 约瑟夫问题
- 提高Delphi的编译速度====收藏转帖
- c语言的宏定义
- 一个ASP.NET长文章分页显示函数
- shell循环读取
- matlab调用jmathplot的jar方法
- IE FF OPERA都可用的弹出层
- delphi中关于bpl发布时将vcl60.bpl,vcldb60.bpl......等多个bpl 打包成一个bpl的方法=====转帖收藏
- select()
- excel转换txt文本(matlab版本)
- Linux 测试工具
- 今天终于注册csdn账号了
- matlab生成html调用flash示例
- STM32--EXIT例子