Subject: Re: CCL:Matlab!!

From: Ioana Cozmuta <[email-masked]>
Date: Thu, 10 Apr 2003 13:19:55 -0700 (PDT)

Hi Pradipta,

I am not sure if I understand it right, if you want to plot the potential
V at each set of coordinates (x,y,z) then you already have a 4D function.
So you would need something like the 3 coordinates and a color for the 4th
value. I know AVS can do that but you have to learn how to use it.

Regarding matlab. Let's say you have indeed 3 columns of data: x, y, z
 or z, y, and V. The way I do it is I read all data in one matrix and then
split that in three (of course you can read it in four but you can only
plot 3 at a time
Here is a piece I am using:

close all;
clear all;
fid = fopen('datafile.dat', 'r');
a = fscanf(fid, '%g');
fclose(fid);
n = size(a,1)/3;
for i = 1 : n
        x(i) = b(3 * i - 2);
        y(i) = b(3 * i - 1);
        z(i) = b(3 * i);
end;
plot3(x, y, z, '.');
grid on;

(you need a graphical display with this last option so in case you ssh do
not forgot to forward it).

I think however that you should try and use something else. If you are
generating the electrostatic potential from a Delphi calculation the
InsightII interface has the possibility to let you plot that.
Alternatively you may use VMD to do this plots. Below is an e-mail from
John Stone from the VMD list.

Hope this is of some help for you,
Ioana

*********************************
John Stone <[email-masked]> escreveu:

> Dear Vlad,
>   There are two VMD scripts available which may be of interest to you
> since you have access to Delphi.  One is "potsel" which calculates
> potential for an atom selection in VMD, and the other is "potsurf" which
> colors a surface representation in VMD by the potential values supplied
> by Delphi.  These two scripts should be a good starting point for you to
> get VMD working with Delphi.
>
> The two scripts are here:
>   http://www.ks.uiuc.edu/Research/vmd/script_library/scripts/potsel/
>   http://www.ks.uiuc.edu/Research/vmd/script_library/scripts/potsurf/
>
> Along the same lines, I believe that Nathan Baker's APBS package comes
> with some scripts to allow it to work with VMD. It is available for
> free, and they've got a web portal setup for running jobs on the NPACI
> machines:
>   http://agave.wustl.edu/apbs/
>
> Thanks,