[scilab-Users] "griddata" functuion

Antoine Monmayrant antoine.monmayrant at laas.fr
Thu Oct 14 14:13:35 CEST 2010


  Le 14/10/10 11:43, Samuel GOUGEON a écrit :
>  ----- Message d'origine -----
> De : hosomi
> Date : 14/10/2010 08:20:
>> Hi,
>>
>> I have a trouble on scilab.
>> I would like to plot csv data by sclilab. I attached the M-code,
>> graphics of MATLAB, and csx data.
>>
>> How can I get the same result as MATLAB with scilab?
> For scattered data, you must use cshep2d() and eval_cshep2d().
Watch out with this one!
Contrary to Matlab griddata that does linear interpolation, "cshep2d" 
uses cubic shepard that introduces a lot of under- and over-shoot 
between sample data points.
It looks nicer than linear interpolated data, but can be a bit misleading.

Antoine
> So a possible equivalent script could be :
>
> dat = eval(read_csv("data1.csv"));
> N = 100;
> x = ones(N,1)*linspace(min(dat(:,1)),max(dat(:,1)),N);
> y = linspace(min(dat(:,2)),max(dat(:,2)),N)'*ones(1,N);
> z = eval_cshep2d(x,y,cshep2d(dat));
> clf
> surf(x,y,z)
> //e = gce(); e.color_flag=3; // interp color mode
> xtitle("Merit Function","X","Y")
>
> Regards
> Samuel
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20101014/c7473d50/attachment.htm>


More information about the users mailing list