Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

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

2 vues (au cours des 30 derniers jours)
Raghvendra Tiwari
Raghvendra Tiwari le 17 Fév 2017
Clôturé : MATLAB Answer Bot le 20 Août 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.

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by