Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

How to call another .fig and its .m file when click on subplot

2 Ansichten (letzte 30 Tage)
Raghvendra Tiwari
Raghvendra Tiwari am 17 Feb. 2017
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Hey there, I am interacting with multiple arduino board at same time, and according to total no of serial port I am ploting graph (in dummy.fig and dummy.m) for each and every port, but i need to open another UI file (Which I coded earlier it have first.m and first.fig) and I need to send parameter port number, means when user will click on COM5's subplot then I need to send "COM5" as parameter to first.m file.
here is my code for subplot and its click event
a = 4; % this will be length_of_AvailablePort sendPortName = {'COM5','COM6','COM5','COM6','COM5','COM6','COM5','COM6'}; % this will be portname x = linspace(0,10); y1 = sin(x);
r = totalPorts(a).rows; c = totalports(a).cols; for i=1:a h =subplot(r,c,i); plot(x,y1); title(sendPortName(i)); set(h, 'ButtonDownFcn', {@first, sendPortName(i)});
end
but i dont know how I can retrieve data in first.m file.

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by