Register to reply

MATLAB exponent problem

by swartzism
Tags: exponent, matlab
Share this thread:
swartzism
#1
Jun3-10, 03:04 PM
P: 73
I am trying to do a very simple problem on MATLAB, but I do not know much about MATLAB so this is challenging. Here is the code:

y=0:50:300;
D=0.210;          % D is the mean sediment diameter
w=14*D^(1.1);     % w is the particle fall speed
A=0.067*w^(0.44); % A is the sediment parameter
h=A*y^(2/3);      % h is the shoreline depth under water
plot (y,h);
What I would like to happen is produce a graph of h=1.005*y^(2/3) with coordinates of h from 0 to 5 in increments of 0.5 and coordinates of y from 0 to 300 in increments of 50. The error I get is:

??? Error using ==> mpower
Inputs must be a scalar and a square matrix.

Error in ==> beachprof at 5
h=A*y^(2/3); % h is the shoreline depth under water


What is going on here and how can I fix it?
Phys.Org News Partner Science news on Phys.org
Sapphire talk enlivens guesswork over iPhone 6
Geneticists offer clues to better rice, tomato crops
UConn makes 3-D copies of antique instrument parts
shoehorn
#2
Jun3-10, 10:33 PM
P: 448
Your problem is in this line:

h=A*y^(2/3);
What you want is:

h=A*y.^(2/3);
To understand the difference, read the docs:

doc mpower
doc power


Register to reply

Related Discussions
Problem solving equation with negative exponent Calculus & Beyond Homework 8
Matlab ODE problem Math & Science Software 3
Confusing exponent problem General Math 3
Exponent problem General Math 10
Exponent integral problem Calculus 4