|
On Oct 29, 10:06 pm, xiao <littledd...@gmail.com> wrote:
> On Oct 28, 9:17 pm, NZTideMan <mul...@gmail.com> wrote:
>
>
>
> > On Oct 29, 5:28 am, "nanxyzzz zhang" <littledd...@gmail.com> wrote:
>
> > > Hi, everyone, i am new to matlab and I have a question.
> > > i want to make a contour plot, the x axis is longitude and the Y axis is the depth.
> > > The contour plot that i want to plot is 46*7 array.
> > > I created the axis like this:
>
> > > axesm('mercator','MapLonLimit',[-78.8 158])
> > > depth=[50 70 100 140 190 240]
>
> > > But I have no clue what i should do next. I tried to do it like
>
> > > contourf(axesm,depth,plot)
>
> > > but it does not work...... Can anyone give some clues?
>
> > > Thank you very much
> > > XX
>
> > I assume your array is plot(46,7), correct?
> > This is a VERY BAD choice of variable name because plot is a
> > frequently-used function in Matlab, so next time you go to use it, you
> > will be screwed.
> > Apart from that, there are two reasons why it won't work:
> > 1. Your depth has only 6 elements, where it should have 7 to match
> > plot(46,7)
> > 2. You need to transpose the matrix plot, using plot' so that it has
> > dimensions 7x46
>
> Thank you very much NZ, I transposed my depth array and renamed the
> plot array to temperature.
> But it looks it still does not work. When I try it like this:
>
> contourf(axesm,depth,temperature)
>
> it gave me the error:
> ??? Undefined function or method 'almanac' for input arguments of type
> 'char'.
>
> Error in ==> axesmui>geoidupdate at 2724
> geoidvec(n+1,:) = almanac(planet,param);
>
> Error in ==> axesmui>MainDialog at 228
> [ptr,list] = geoidupdate(mstruct.zone,mstruct.geoid);
>
> Error in ==> axesmui at 109
> eval([callback,'(''',action,''')'])
>
> Error in ==> axesmui at 62
> axesmui('MainDialog','AxesEntries')
>
> Error in ==> axesm at 67
> cancelflag = axesmui;
>
> Why is that? thank you very much
>
> XX
No, it's not contourf that's giving you that error, it's axesm.
I don't have that in my version of Matlab, so I can't help you.
|