Save and rename part of files in plot

1 visualizzazione (ultimi 30 giorni)
Hi,
I have a plot3 with 38 files in red and 12 files in blue. Now I want to select 12 files from red in the plot and rename those to simular names as the blue files.
I have no idea where to start and if this will be possible.
So I need to add a 'click function' and after the click another click or add name function how to save it.
Thanks in advance.
%open files blue
for k = 1:length(f);
filename = fullfile(f(k).folder, f(k).name);
CSVData = readmatrix(filename, 'Range', 1, 'Delimiter', ','); [filepath,name,ext] = fileparts(filename); indexCSV = [(0:size(CSVData,1)-1)' CSVData];
xC{k,1}=CSVData(:,7); yC{k,1}=CSVData(:,8); zC{k,1}=CSVData(:,9); radC{k,1}=CSVData(:,2)/2;
indexC =indexCSV(:,1);
end
%open files red
for i = 1:numbcenterlines
Ofilename = 'vessel_'+string(i)+'.csv';
DataText = readmatrix(Ofilename, 'Range', 1, 'Delimiter', ','); b = [(0:size(DataText,1)-1)' DataText];
index =b(:,1);
x =DataText(:,1); y =DataText(:,2); z =DataText(:,3);
for k = 1:length(f)
plot3(xC{k,1},yC{k,1}, zC{k,1},'-b')
hold on
end
plot3(x,y,z, '-r');
hold on
end

Risposta accettata

Vimal Rathod
Vimal Rathod il 28 Gen 2021
Hi,
You could add the file name as a tag before plotting the line and also add a Onclick callback. So when you click the line, you could code it to check the tag and probably change the file name and save.
Refer the following link to know more about Tag property of line. Plot3 and plot function both uses line object internally to create lines and hence you could set this property even with plot3.
Refer to the following link to know more about renaming file.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by