• Support PF! Buy your school textbooks, materials and every day products Here!

Simple MATLAB problem that has me stumped

  • #1

Homework Statement


Use an array for single digit values of x [1,10] to find values of y for the equation y = (e^3x) / (sqrt (x+1)).


Homework Equations





The Attempt at a Solution


So, I tried defining the function as Function [ (e^3x) / (sqrt (x+1))] = y(x) , but that gave me an error message. I then tried to just define x and y first with syms x; and syms y;, and then define y as y = (e^3x) / (sqrt (x+1)).

However, since this is actually not a function, i was not able to arrayfun() to get the answer that I needed. This is my first MATLAB homework and the TA didn't explain anything, he just said to do it.

Any help would be greatly appreciated.
 

Answers and Replies

  • #2
272
0
Here this will fix your problem

Code:
x = 1:10;
y= (exp(3*x)) ./ (sqrt (x+1))
Take note of the dot (" . ") That tells matlab to perform a value by value operation rather than a matrix operation.
 

Related Threads on Simple MATLAB problem that has me stumped

Replies
6
Views
3K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
1
Views
4K
  • Last Post
Replies
3
Views
2K
Replies
1
Views
5K
  • Last Post
Replies
1
Views
949
Replies
10
Views
707
  • Last Post
Replies
1
Views
1K
Replies
5
Views
2K
Replies
15
Views
1K
Top