How to create a sequence of intervals
If my data is y= 2,-3,4,-1,6 and my x=-4. is it possible to obtain a sequence of intervals as follows:
intervalle(1)= [-abs(x-y(1)),abs(x-y(1))], intervalle(2)= [-abs(x-y(2)),abs(x-y(2))],… I tried the code:
y=[2 -3 4 -1 6];
x=-4;
n=length(y);
intervalles=[-abs(x-y),abs(x-y)];
for k=1:n
intervalles(k)=[-abs(x-y(k)),abs(x-y(k))];
endIf my data is y= 2,-3,4,-1,6 and my x=-4. is it possible to obtain a sequence of intervals as follows:
intervalle(1)= [-abs(x-y(1)),abs(x-y(1))], intervalle(2)= [-abs(x-y(2)),abs(x-y(2))],… I tried the code:
y=[2 -3 4 -1 6];
x=-4;
n=length(y);
intervalles=[-abs(x-y),abs(x-y)];
for k=1:n
intervalles(k)=[-abs(x-y(k)),abs(x-y(k))];
end If my data is y= 2,-3,4,-1,6 and my x=-4. is it possible to obtain a sequence of intervals as follows:
intervalle(1)= [-abs(x-y(1)),abs(x-y(1))], intervalle(2)= [-abs(x-y(2)),abs(x-y(2))],… I tried the code:
y=[2 -3 4 -1 6];
x=-4;
n=length(y);
intervalles=[-abs(x-y),abs(x-y)];
for k=1:n
intervalles(k)=[-abs(x-y(k)),abs(x-y(k))];
end indexing on intervals, matlab MATLAB Answers — New Questions