MATLAB Answers

Create an "equispaced" vector that includes a number of given points

조회 수: 5(최근 30일)
Alejandro Fernández
Alejandro Fernández 2021년 4월 22일
댓글: Alejandro Fernández 2021년 4월 22일
Hi, I was wondering how I could make a vector that I have obtained with linspace for example of the style:
v = linspace(0,7,8)
So v = [0 1 2 3 4 5 6 7]
And given another vector in the variable a such as could be:
a = [1 1.5 4 6.2]
Introduce the elements that are not in the vector v in the position so that the result is increasing.
So the result should be:
result = [0 1 1.5 2 3 4 5 6 6.2 7]
  댓글 수: 3
Alejandro Fernández
Alejandro Fernández 2021년 4월 22일
Yes sorry, I forgot to write that line of code when I was typing the first time. But don't worry, it's perfect.

댓글을 달려면 로그인하십시오.

추가 답변(0개)

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by