- #1
ineedhelpnow
- 651
- 0
We want to know the square and the cube of each of the following numbers: 1, 2 and 3. You can have MATLAB obtain these results as follows.
Create a vector [1 2 3] . Create a vector [2 3]. Use these two vectors as inputs to the meshgrid function (with the 3-element vector as the first argument), which will produce two matrices. Each of these matrices will have 2 rows and 3 columns. The first matrix will have rows that equal the first vector. The second matrix will have columns with the elements of the second vector. Use the operator .^ (element-by-element raising to a power) to generate a matrix with the desired answers. (This final matrix should have 2 rows and 3 columns.)
hi (Wave)
so here's what i did so far
im lost on what to do next
Create a vector [1 2 3] . Create a vector [2 3]. Use these two vectors as inputs to the meshgrid function (with the 3-element vector as the first argument), which will produce two matrices. Each of these matrices will have 2 rows and 3 columns. The first matrix will have rows that equal the first vector. The second matrix will have columns with the elements of the second vector. Use the operator .^ (element-by-element raising to a power) to generate a matrix with the desired answers. (This final matrix should have 2 rows and 3 columns.)
hi (Wave)
so here's what i did so far
Code:
x=[1 2 3];
y=[2 3];
[x,y]=meshgrid(x,y)
im lost on what to do next