matrix plot how to?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

matrix plot how to?

eugenia
Dear all,
I have octave 4.2.2 running under Fedora.

I want to visualize a 2x6x6067 matrix. It has the following aspect:

>> CHIS1=ncread(fullfile(obsX, 'ChannelInfo_bS.nc'),'ChanAmpPhase')
CHIS1 =

ans(:,:,1) =

   3.3208e-04   3.6136e-04   3.4397e-04   3.2282e-04   3.0488e-04  
3.5576e-04
   7.6304e+01   7.5384e+01   7.6021e+01   8.0571e+01   8.1593e+01  
7.1823e+01

ans(:,:,2) =

   7.8157e-04   6.4418e-04   6.8477e-04   5.5001e-04   4.8390e-04  
4.0325e-04
   7.6915e+01   8.1935e+01   8.8335e+01   7.9364e+01   8.6596e+01  
7.3393e+01

ans(:,:,3) =

   0.00039   0.00025   0.00046   0.00040   0.00039   0.00000
   0.03458   0.07222   0.08307  -0.23317   0.26613   0.00000
.
.
.
ans(:,:,6066) =

   3.8324e-04   3.4421e-04   3.7266e-04   3.9962e-04   2.6922e-04  
2.5487e-04
   1.1616e+02   1.1836e+02   1.0435e+02   1.1913e+02   1.1451e+02  
1.1473e+02

ans(:,:,6067) =

   1.9845e-04   2.3307e-04   2.0106e-04   1.9758e-04   3.2063e-04  
2.7223e-04
   9.2338e+01   8.5952e+01   5.7616e+01   6.9950e+01   6.7347e+01  
9.6147e+01

>>

I tried with scatter3, plot3 and surf but I do not know if they are the
convenient instructions or if I wrote them well because I am new in Octave.
I have no problems to plot 2D, but it is not a good idea.

Thanks in advance,
Maria Eugenia




--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: matrix plot how to?

marco atzeri-2
Am 08.01.2019 um 02:11 schrieb eugenia:

> Dear all,
> I have octave 4.2.2 running under Fedora.
>
> I want to visualize a 2x6x6067 matrix. It has the following aspect:
>
>>> CHIS1=ncread(fullfile(obsX, 'ChannelInfo_bS.nc'),'ChanAmpPhase')
> CHIS1 =
>
> ans(:,:,1) =
>
>     3.3208e-04   3.6136e-04   3.4397e-04   3.2282e-04   3.0488e-04
> 3.5576e-04
>     7.6304e+01   7.5384e+01   7.6021e+01   8.0571e+01   8.1593e+01
> 7.1823e+01
>
> ans(:,:,2) =
>
>     7.8157e-04   6.4418e-04   6.8477e-04   5.5001e-04   4.8390e-04
> 4.0325e-04
>     7.6915e+01   8.1935e+01   8.8335e+01   7.9364e+01   8.6596e+01
> 7.3393e+01
>
> ans(:,:,3) =
>
>     0.00039   0.00025   0.00046   0.00040   0.00039   0.00000
>     0.03458   0.07222   0.08307  -0.23317   0.26613   0.00000
> .
> .
> .
> ans(:,:,6066) =
>
>     3.8324e-04   3.4421e-04   3.7266e-04   3.9962e-04   2.6922e-04
> 2.5487e-04
>     1.1616e+02   1.1836e+02   1.0435e+02   1.1913e+02   1.1451e+02
> 1.1473e+02
>
> ans(:,:,6067) =
>
>     1.9845e-04   2.3307e-04   2.0106e-04   1.9758e-04   3.2063e-04
> 2.7223e-04
>     9.2338e+01   8.5952e+01   5.7616e+01   6.9950e+01   6.7347e+01
> 9.6147e+01
>
>>>
>
> I tried with scatter3, plot3 and surf but I do not know if they are the
> convenient instructions or if I wrote them well because I am new in Octave.
> I have no problems to plot 2D, but it is not a good idea.

How you want to plot them ?

You have 3 indexes and 1 value.
In a 3D drawing you have usually 2 indexes as X,Y and 1 Z value.
You have one index too much.



>
> Thanks in advance,
> Maria Eugenia
>
>
>
>
> --
> Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
>
>

---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus



Reply | Threaded
Open this post in threaded view
|

Re: matrix plot how to?

eugenia
Hi Marco,
as far as I could see from the octave description of my variable, it is a
2x6x6067 matrix.

I know that index (1,:,:) represents 1 row with values from 0 to 1.
(2,:,:) gives me values from 180 to 180
then  the second index represent 6 channels and the last index has 6067
values

So... it has 3 dimensions.

Thanks



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: matrix plot how to?

Doug Stewart-4


On Tue, Jan 8, 2019 at 9:12 AM eugenia <[hidden email]> wrote:
Hi Marco,
as far as I could see from the octave description of my variable, it is a
2x6x6067 matrix.

I know that index (1,:,:) represents 1 row with values from 0 to 1.
(2,:,:) gives me values from 180 to 180
then  the second index represent 6 channels and the last index has 6067
values

So... it has 3 dimensions.

Thanks



Here is one way Probably not what you want but it might help

q=rand(2,6,22);
x1=q(1,1,:)(:)
y1=q(2,1,:)(:)

x2=q(1,2,:)(:)
y2=q(2,2,:)(:)

x3=q(1,3,:)(:)
y3=q(2,3,:)(:)
plot(x1,y1 ,x2,y2,x3,y3)

 

--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html




--
DASCertificate for 206392