Really interesting question.Does it have a solution?

2 Ansichten (letzte 30 Tage)
Sajad Eng
Sajad Eng am 5 Jan. 2022
Beantwortet: Image Analyst am 5 Jan. 2022
Produce a row vector x of 5 between 2 and 3 in Matlab commands, in which, the elements can be spaced equally.
  2 Kommentare
Star Strider
Star Strider am 5 Jan. 2022
Yes!
It has a solution!
Steven Lord
Steven Lord am 5 Jan. 2022
This sounds like a homework assignment. If it is, show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty and we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the MATLAB Onramp tutorial (https://www.mathworks.com/support/learn-with-matlab-tutorials.html) to quickly learn the essentials of MATLAB.
If you aren't sure where to start because you're not familiar with the mathematics you'll need to solve the problem, I recommend asking your professor and/or teaching assistant for help.

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Walter Roberson
Walter Roberson am 5 Jan. 2022
No, it does not have a solution in double precision. The theoretical values would be
2, 2+1/6, 2+2/6, 2+3/6, 2+4/6, 2+5/6, 3
However when you work in double precision, 1/6 cannot be exactly represented, and the difference between adjacent terms will not be exactly the same in all cases, violating the equal-space requirement.

Image Analyst
Image Analyst am 5 Jan. 2022
If you're looking for a MATLAB function, try linspace().

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2010b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by