user interface - Minimal example of a standalone matlab GUI app -
i have written matlab code antenna design, , make user-friendly gui project others can use easily.
before move actual gui development, overall impression of whether matlab choice gui-based application, in terms of
a) whether it's easy / straightforward create,
b) whether it's possible user use resulting app without matlab licence / installation.
please can provide minimal matlab gui example demonstrating basic concepts of matlab guis me idea of involved, , point me in right direction on how might deploy standalone matlab app, if @ possible?
optional - (opinion based, feel free ignore if feel "opinions" on stackoverflow): appreciate explanatory comments on whether choice in general compared other typical options, or if people advise me migrate matlab language specific purpose of gui apps (and why).
matlab (in opinion) 1 of easiest languages there design guis, since need add ui elements normal figure windows , link standard functions callbacks. there graphical tool create these too, called guide, never bothered because coding hand in first place easy.
here's simple "app" plots spiral, slider control controls scale:
%%%%%% in file myplot.m %%%%% function myplot %% create initial figure , spiral plot figure; axes ('position', [0.1, 0.3, 0.8, 0.6]); t = linspace (0, 8*pi, 100); x = t .* cos(t); y = t .* sin(t); plot (x, y); axis ([-100, 100, -100, 100]); %% add ui 'slider' element hslider = uicontrol ( ... 'style', 'slider', ... 'units', 'normalized', ... 'position', [0.1, 0.1, 0.8, 0.1], ... 'min', 1, ... 'max', 50, ... 'value', 10, ... 'callback', {@plotstuff} ... ); %% callback function called slider event function plotstuff (h, event) n = (h, 'value'); x = n * t .* cos(t); y = n * t .* sin(t); plot (x, y); axis ([-100, 100, -100, 100]); end end
regarding second question, there is way create standalone applications users don't have matlab installed, there caveat
a) need matlab compiler toolbox package standalone app, and
b) end-users have install matlab compiler runtime in order code run. (similar how need install java runtime in order run java code).
if neither of above dealbrakers you, yes, matlab suitable , straightforward option gui app.
ps1: useful link: https://uk.mathworks.com/discovery/matlab-gui.html
ps2: octave behind matlab's gui capabilities, , should avoid nested functions callbacks, otherwise new qt interface has come ui elements functionality too. simple guis, octave should work , worth trying (and free, open, more deployable, , actually looks nicer in opinion too).
Comments
Post a Comment