Star rating in Matlab GUI - matlab

Is there a way to add a rating button to a matlab GUI?
something like that
http://www.fyneworks.com/jquery/star-rating/

AFAIK there isn't a built in UIControl that provides this functionality. The closest control that I can think of is slider. Specify the MIN, MAX, and step size and the user will be bound to forced to select one of a few specific values.
Other options integrating a JAVA component into your GUI
http://blog.noblemaster.com/2010/08/31/star-rating-panel-for-java-swing/
http://code.google.com/p/starrating/
Or you can come up with a clever way to do it in matlab using a collection of radiobuttons and images.

I ended up writing my own rating system
http://www.mathworks.com/matlabcentral/fileexchange/41997-star-rating

Related

Interactive bar chart.user changes y axis value at runtime by dragging it

For example 3 columns are there with y axis value as 100,200,300 in barcharts.
User select one column alone and drag it to 500 value in y-axis.
How to achieve this?
Is it available in library like androidplot or aChartPlugin?
If not which plugin support this requirement.Our project is for Android tablets
Please provide me sample code for this requirement.Thanks in advance.
To my knowledge no library exists for Android that provides 'out of the box' capabilities to drag and reorganize data. Having said that, any library that provides you with a way to correlate touch events to data elements and also supports dynamic updates should be suitable.
If you have specific requirements about how the "drag" is implemented then you may end up having to roll your own library or customize an existing one to your needs. If not, here's a basic workflow you could implement with Androidplot that represents the drag operation as a cursor:
1 - Detect selections using an OnTouchListener. Here's an example of a bar plot that allows bar selection via touch. Gives a full example of converting screen coords to model elements etc. Create and add an instance of XValueMarker denoting the current position of the selection. (An XValueMarker is basically a customizable vertical line marking an x-val.
2 - Detect "drag" events using an OnTouchListener. Here's an example that detects zooming and scrolling. It's not the same thing exactly but the scrolling logic is close enough to give you the general idea.
3 - As the user drags, update the position of the XValueMarker by XValueMarker.setValue(Number).
4 - Once the "drag" ends, remove the XValueMarker and modify the underlying XYSeries to reflect the change using basic data structure manipulation(s).
And of course remember to always call plot.redraw() after each operation that is expected to alter the appearance of the plot in some way.

MATLAB: Changing plotperform window name, and more

So I'm working on some simple neural network problems for a class I'm taking, and I've mostly done all of the work.
However, I'd like to be able to press run and have all of the relevant figures and graphs pop out so I can easily show my work.
To do this I've been drawing setting the names of figures that I plot in using the
figure('Name', 'NameGoesHere', 'NumberTitle', 'off')`
variant of the figure function.
The thing is, one of the things that I have to show are performance graphs for the different networks I made, and using plotperform(tr) sets the window name to Performace (plotperform) even if I try setting the figure name to something else. Any help?
Here's a picture showing what I mean:
Oh, and, being really new to Matlab, correct me if I'm wrong, but since performance is defined as mean absolute error, the lower it is, the better right? So is there a way to set is so plotperform actually selects the lowest point of the graph as the best instead of the first one?
Another thing I'd like to be able to do is have the training information nntraintool open in a new window every time I call the train(netA, P, T) function. Right now, every time it's called it just overwrites the previous info in the nntraintool window. Is it even possible to do this?
This is the window I'm talking about:

add simple geometric elements to GUIDE GUI

I am desiging a simple GUI application in Matlab using GUIDE.
I am displayed a number of axis - and I would like to add some simple design elements to make the interface clearer. I would like to draw a colored rectangle around an axis (seperate from the axis)... there are two such axes, each displaying details of some things shown in a third plot, and I would like this color clue to link the details to the overview.
So is it possible to add simple geometric shape objects to a Matlab GUI? I don't see anything but controls in GUIDE but perhaps its possible to add them manually with an explicit command?
It is generally difficult to draw any random shape. Except Square & rectangle, for which you can create panels and change the properties like BorderWidth and HighlightColor.
Since MATLAB GUI is based on Java, you can create any object in MATLAB GUI which can be created in Java. You can refer to this website [1] for further learning.
[1] http://undocumentedmatlab.com/matlab-java-book/

Selecting a ROI manually in Matlab

I'm trying to select a user-defined area and fill with 1s, preferably with mouse input. Any suggestion how? Thanks.
The command
roipoly
does exactly what you're looking for.
You'll need the Image Processing Toolbox to use roipoly as Georg suggested.
If you don't have that, you could try creating a rubber band box using
rbbox
There's a good example in the help. You might need to fiddle with units depending on how you're displaying your data. Remember to click and hold, drag and release..
h=impoly;
This code helps you to select a closed polygon of the image.

How to dynamically add edit boxes in MATLAB GUI?

I use the inputdlg function to display a dialog box in which the user writes in several edit boxes. The number of boxes depends on the value of a variable, so I can have 3 ou 11 boxes but I figured out how to update the number of boxes in the dialog box according to the value of this variable.
Now I want to do the same thing with a GUI (and not a simple dialog box) because I would like to add some features in it (like a static text) by using uicontrol. (I'm forced to do that because it's impossible to extract the handle of the dialog box displayed by inputdlg). When you do it with GUIDE, you have to specify how many boxes you have but I can't give a fixed number of boxes, it's variable.
To sum up, I would like to dynamically increase the number of edit boxes in a GUI. How can I do that?
Suppose you want to use uicontrol.
The help is very comprehensive.
Your best bet is to have a generic function that you can call with the necessary parameters to define the object you wish to create.
Something along the lines of this:
function CreateEditBox ( various parameters/necessary handles )
set( objectHandle, 'Property', value )
% and more for whatever it is you need to define.
end