0
我想讓我的matlab腳本將X和Y分隔成兩個文件,但我不確定如何區分它們。我的代碼如下所示:分離x和y信息
close all
clear all
clc
jpgFiles = dir('*.jpg');
numFiles = length(jpgFiles);
mydata = cell(1,numFiles);
% mydata = zeros(numFiles);
for k = 1:numFiles
mydata{1,k} = imread(jpgFiles(k).name);
end
% initialize your array of coordinates
data = zeros(30,2,numFiles);
for k=1:numFiles
figure;
imshow(mydata{k});
[x, y] = ginput(30) %select 30 points on the image and return the
%xy coords in return
data(:,:,k) = [x y]; %save the xy coords as data matrix
end
%Get data into a csv text file for easy export to excel
filename = 'test.csv';
csvwrite(filename,data)
我試圖寫"data(:,:,k) = [x y];"
到2線,一條X和一個與年,但不起作用。 任何人都可以幫助我,因爲它會爲我節省很多時間,因爲我只需要Y信息。