Answered
How can I use ginput in app designer?
ginput is now supported in AppDesigner starting in r2020b We still don't have an option to specify the target figure handle in ...

6 years ago | 8

| accepted

Answered
How we can plot Indian flag ploting
Download an image of the flag. use imread and imshow to read/plot the flag. Here's an example https://www.mathworks.com/...

6 years ago | 0

Answered
How to unpack a table with a column of structs while preserving other columns?
Tnew is the input table (attached). gtTbl = cellfun(@struct2table, Tnew.groundtruth2DBB, 'Unif', false); T = [repelem(Tnew(:...

6 years ago | 0

| accepted

Answered
naming file with count
sprintf('circle_cropped_%03d.jpg',count) % ^^

6 years ago | 0

Answered
Show mouse position in another subplot
Here's a full demo that tracks mouse movement in axis #1 and replicates it in axis #2. The windowbuttondownfcn function updates ...

6 years ago | 3

Answered
Legend error. What did I do wrong here?
The "width" figures contain multiple lines on top of each other just like in your last question. To demonstrate, open the wid...

6 years ago | 0

| accepted

Answered
Legend error. How to fix?
Move this line to end, after copying the line objects. legend('\alpha=0','\alpha=1/9','\alpha=1/10','location', 'northeast') A...

6 years ago | 0

| accepted

Answered
Icon for legend not showing in graphs
This annoying problem has popped up for me too, recently. If you're experiencing the same problem I have, you can fix it a fe...

6 years ago | 1

Answered
Can I add 95% confidence ellipses around groups of data in a pca plot (biplot)?
If you know the center of the clusters and the CI's along the x and y axes for each cluster, you can use this function to plot t...

6 years ago | 1

| accepted

Answered
Adding label to axis ticks
Set the XTickLabel propery of the axis. Use newline to break apart a string into multiple lines. Quick demo: ax = cla(); ax...

6 years ago | 0

| accepted

Answered
Issue with cvpartition warning message
The warning message indicates that at least one of your group values is not represented within the test set. Stratified samplin...

6 years ago | 0

Discussion


New in R2020b: Two new marker symbols
' The Matlab r2020b release introduces the new horizontal ('_') and vertical (' | ') line marker symbols that are centered ar...

6 years ago | 13

Answered
legend in subplot
Update Since this thread continues to get 500+ views per month 9 years later, here's an updated solution for Matlab r2020b or l...

6 years ago | 3

Answered
Multiple plots with same Legend
Update The graphics handles vector h in legend(h) can contain objects from any axes (created by axes(), subplot(), or tiledlayo...

6 years ago | 1

Answered
global legend in tiledlayout
Global legends can be created by specifying the object handles that exist in any subplot (created by subplot or nexttile) within...

6 years ago | 5

Answered
Adding a global legend to a tiledlayout
Update As of Matlab r2020b, legend location can be specified relative to axes created within an TiledLayout. This demo below p...

6 years ago | 7

Answered
Adding legend for subplot when none of the subplots include all legend entries
All you need are the handles to each object you want to include in the legend and the handles can come from different subplots w...

6 years ago | 4

| accepted

Answered
Can you plot polarplots so that theta zero location is at any arbitrary angle or are top left bottom right the only options?
Here's a demo showing how to rotate line objects and theta ticks on polar axes. The orientation of the polar axes is controlled...

6 years ago | 3

| accepted

Answered
Plots every datapoint instead of a line
The problem occurs when yyaxis is used (remove yyaxis and example provided by OP behaves as expected). The full linespec is n...

6 years ago | 1

Answered
Add legend to mutiple figures in a loop with conditional
I agree with Mario that you just have to provide the axis handle to specify where each legend goes. But there's some other stuf...

6 years ago | 2

| accepted

Answered
Percentage values in scatterhist histogram
The histograms are normalized which means their bar heights are already a percentage. The percentage of each bar can be found ...

6 years ago | 2

| accepted

Answered
what do '--' and '-.' mean?
These are line styles. Also check out the LineSpec input to the plot function. plot(X,Y,LineSpec)

6 years ago | 0

| accepted

Answered
Maximum likelihood with Heteroskedasticity
You are suffering from the side effects of using global variables (incorrectly). Don't use global variables in Matlab. Ins...

6 years ago | 0

| accepted

Answered
Changing transparency of individual bars in bar
You can plot the bars one at a time or in groups that all have the same FaceAlpha level. That way the bars with differen alpha...

6 years ago | 1

| accepted

Answered
Removing rows duplicates based on some conditions
Method 1 Here's a simple solution that assumes matching rows in columns 1:3 are next to each other. The assert command tests t...

6 years ago | 0

| accepted

Answered
Fit a line to data using regress
b = regress(y,x) If x and y are vectors, they must be column vectors regress(y(:),x(:)) For alternatives, see https://www....

6 years ago | 0

Answered
a small problem with linspace
11981420 is not divisible by 40. 11981420/40 ans = 2.9954e+05 % = 299535.5 size(s) ans = 1 299535 29...

6 years ago | 0

| accepted

Answered
How do I change the colour of certain indices in scatterplot?
Here's are 4 demo that all achieve the same result. Xvals = [1,2,3,4,5,6,7,8,9]; Yvals = [2,5,5,5,2,2,5,5,5]; % Show scatt...

6 years ago | 0

| accepted

Answered
How to find what number is missing from a range inside of an array?
Check out Lia = ismember(A,B) Example full = [1;2;3;4;5]; sample = [2;4;5]; idx = ismember(full, sample); full(~idx)

6 years ago | 0

| accepted

Answered
Disable app while calculating
How to disable app components while app is busy List all components you'd like to disable/enable in a vector of handles. Impor...

6 years ago | 4

Load more