Hello good morning, I have a problem to see if anyone can help me.
I have an A matrix of , in the first column are the values of the X axis and in the second column the values of the Y axis, I need to get a B matrix of the same dimensions and identical positions of X and Y in which the data correspond to the process of trafficking the data of A and apply:
figure
scatter(A(:,1),A(:,2),'filled')
set(gca,'YDir','reverse')
So when I create B what is the matrix that i don't know how to create I expect to obtain the same result but without reversing the axis:
figure
scatter(B(:,1),B(:,2),'filled')
set(gca,'YDir','normal')

 채택된 답변

Rik
Rik 2020년 8월 4일

0 개 추천

Since reversing the y-direction is mostly equivalent to flipping the sign:
B=[A(:,1) -A(:,2)];

댓글 수: 4

Alejandro Fernández
Alejandro Fernández 2020년 8월 4일
Yes that works, but I need that the Y values are the same than the 'reverse' method, I mean, don't be negative
Alejandro Fernández
Alejandro Fernández 2020년 8월 4일
Matrix A: Matrix A
And what I want to obtain when I plot B is this:
B
You can shift them by using original data range:
col2=A(:,2);
col2=min(col2)+max(col2)-col2;
B=[A(:,1) -col2];
Alejandro Fernández
Alejandro Fernández 2020년 8월 4일
Yess!!! That works! Thank you so much!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Vector Fields에 대해 자세히 알아보기

제품

릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by