필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to extract two coloumns from each other?

조회 수: 1 (최근 30일)
nancy
nancy 2017년 1월 3일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi;
I have two "txt" files. I want to extract the second column of "test2" file from the second column of "test1" file. After that; I want to plot linear x vs. logarithmic y axis graphic. (As a matter of fact; x axis is the same in the two files and logarithmic y axis will be of course extracted datas).
Txt files are in the attached files.
Could you please help me?

답변 (1개)

Star Strider
Star Strider 2017년 1월 3일
Try this:
test1 = load('test1.txt'); % Import Data
test2 = load('test2.txt'); % Import Data
test12 = [test1 test2(:,2)]; % Concatenate Column #2 Of ‘test2’ To ‘test1’
figure(1)
semilogy(test12(:,1), test12(:,2:3))
grid
legend('Test 1', 'Test 2')

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by