MATLAB101 help D: I'll attached the problem below.
I just wanted to see how this will look like. Don't show me the code (I have to figure this one out), just show me your output, so that I can have an idea.
...a little bit of hints, maybe?
okay so
u have a 50 by 50 matrix and what are we trying do here with peaks function?
from what I understand, i have to make the 50 by 50 matrices using the "peaks" function. What's a peak function anyway?
www.mathworks.com/help/matlab/ref/peaks.html
Yeah I read that. I'm not sure if I should do Z=peaks(x,y) or do z=peaks(50), x=peaks(50), y=peaks(50) because it says "Use the peaks function to define X,Y,Z" not sure what this part actually means
im looking it up
do u hae some data set of some function i can use peaks on?
I believe you should be using the Z=peaks(x,y)
dont quote me but im pretty sure
okay
what is x and y
no i don't have any set of data.. if i did that, this is how it will look like:
is it supposed to be like that? O.o
Z = peaks(X,Y); evaluates peaks at the given X and Y (which must be the same size) and returns a matrix the same size.
so if im not misinterpreting that your x and y are 50
x and y are both 50 by 50 matrices?
gimme a second lol i may be mistaken
oh crapp i cant use peaks i accidentally named some other program peaks, i gotta put in that program in for peaks again
wait i'm confused now, do i need to define x and y with some function?
can you open your peaks function code
well if we are basing it off the definition then yes you have to define the x and y and they both must be the same value
ok nvm i just renamed the file i can use peaks again
like that?
yup thats what it should look like from what i have knowledge of
did you do z=peaks(50) figure mesh(Z) ?
>> [X,Y,Z]=peaks(50) >> surf(X,Y,Z)
surf(x,y,z) isn't the x and y here represents the matrix then z will be the color of data and the surface height? okay. thank you, i think i got it now :D
[X,Y,Z] = peaks(...); returns two additional matrices, X and Y, for parametric plots, for example, surf(X,Y,Z,del2(Z)). If not given as input, the underlying matrices X and Y are [X,Y] = meshgrid(V,V)
u should mess around with it like
what happens when you put in a meshed grid 50 by 50 for peaks
ok, i'll try that. I already get the idea, so I think I can manage it now I'll ask again if I got stuck or confused :P
quick question, are your matrices like the list of numbers/data showing on your command window?
Join our real-time social learning platform and learn together with your friends!