How to divide a vector by a constant?
Show older comments
c=3*10^8
speeds=(.1*c:.9*c/8:.9*c)
y=1/sqrt(1-(speeds.^2./c^2))
What is my error?
Accepted Answer
More Answers (1)
You need to use elementwise division everywhere in your equation for y
c=3*10^8;
speeds=(.1*c:.9*c/8:.9*c);
% v
y=1./sqrt(1-(speeds.^2./c^2))
1 Comment
Lance Shallenberger
on 16 Sep 2021
Categories
Find more on Data Type Identification in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!