Solving equation with a vector
Show older comments
I'm not sure the term vector is correct, but I hope you'll see what I mean.
I want to solve F(x)=0.
F(x) contains the x i want to solve for and a y = 1:1:10 ([1 2 3 4 5 6 7 8 9 10], this is just an example, actual numbers are somewhat different) and some regular numbers.
The answer I'm looking for is a vector where x1 would be what it is for y2, x2 for y2, x3 for y3 and so on.
How do I go about this? I'm thinking fsolve but I haven't had any luck with that. Could someone point me in the right direction?
The best I can get is B=F(x)==0 which gives me a vector B for y1, y2, y3... But the f is still stuck in there.
If I have to I can post the actual equation, but since I want to know the way to do it, it doesn't seem like it matters. Maybe I'm writing y all wrong for this. I also get an error with matrix dimension during some of my tries.
Example:
F(x)=x-2y=0
y1=1 --> x1=2
y2=2 --> x2=4
y3=3 --> x3=6
x=[2 4 6]
Thank you in advance! :)
1 Comment
burningempires
on 5 Dec 2014
Accepted Answer
More Answers (1)
horn hosanna
on 6 Nov 2017
Create two row vectors: a=2:3:17 and b=3:4:15. Then, by only using
the name of the vectors (a and b), create a row vector c that is made
from elements of a followed by the elements of b.
1 Comment
Torsten
on 7 Nov 2017
https://www.quora.com/How-do-I-merge-two-arrays-in-MATLAB
Best wishes
Torsten.
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!