Answered
Index of the colums which contains only specific char 'B'
Use strcmp or strcmpi along with all. Template: all(strcmp(a,'B'),1) % for columns all(strcmp(a,'B'),2) % for rows

5 years ago | 0

| accepted

Answered
How can I move a colorbar down in a subplot?
After adding the colorbar, change its position property. You can use the positions of the other axes to align the colorbar as n...

5 years ago | 0

| accepted

Answered
plot with light to dark blue colour
Update As of MATLAB R2023a you can use the colormap sky cmap = sky(256); x = linspace(0,.5*pi,500)'; plot(sin(x).*linspace...

5 years ago | 0

| accepted

Answered
Sliding pixel window to get 8 neighbour pixel values
Here's the framework to get you started. An image is displayed and the starting and end coordinates of each 4x3 (width x heigh...

5 years ago | 0

| accepted

Answered
Changing the default version of MATLAB for opening files
For windows 10, follow these instructions (I've used this method recently with r2021a) https://www.bleepingcomputer.com/news/mi...

5 years ago | 0

Answered
Why do I get this error?
closetozeroroundoff(), a 3rd party function not defined in the question, contains more than one input and one of the inputs is a...

5 years ago | 0

| accepted

Answered
re-arrange data
It looks like you want the output to be a cell array. out = {'A', 'B1', 'X6(1.4M), X15(3M), X25(5M), X50(10M), X75(15M), X100...

5 years ago | 0

| accepted

Answered
how to compute the mean value of non-zero elements in each row of a sparse matrix
Assuming you want to preserve row-number in the case were entire rows are 0s, mu = zeros(size(C,1),1); mu(any(C~=0,2)) = mean...

5 years ago | 0

Answered
how to create mouse movement event on UIAxes in APP Designer to catch cursor location on the axes?
Here are 2 methods to capture mouse coordinates within the axes of a figure. In these demos the coordinates of the cursor's cu...

5 years ago | 3

| accepted

Answered
Lettering a Bar Chart
It's better to avoid setting tick labels when possible. Instead, use a categorical variable (xCats) for x, defined by letters ...

5 years ago | 0

Answered
Overlay imagesc and contour in subplot with different colour bars
> the axis handle applies to the whole subplot, and not the indervidual plot commands That's correct. A workaround is to assi...

5 years ago | 0

| accepted

Answered
how to convert logical variable into hexadecimal number in Matlab?
dec2hex(D) hexstr = dec2hex([false true true false]) Or perhaps you want, hexstr = string(double(([false true true false]))...

5 years ago | 0

Answered
Error when trying to follow Deep learning example
Updated answer (11/28/22) The documentation page for the Word-By-Word Text Generation Using Deep Learning example has been upda...

5 years ago | 0

| accepted

Answered
Differential dot in legend using Tex interpreter
To use an overdot as a legend string with TeX interpreter, use a unicode diacritic character (see resources below). For examp...

5 years ago | 0

| accepted

Submitted


Patch for annotationPane errors in GUIDE [Beta]
A patch to the problem of editing GUIs in GUIDE in r2019b (and later?)

5 years ago | 1 download |

0.0 / 5
Thumbnail

Submitted


copyUIAxes
Copy UIAxes (eg. AppDesigner) and most properties to a new figure and recreate the legend and colorbar if they exist.

5 years ago | 5 downloads |

5.0 / 5
Thumbnail

Submitted


removeDrivesFromHistory
A solution to the problem of Matlab consuming an enormous amount of time to recover from an "Undefined function or variable" err...

5 years ago | 2 downloads |

5.0 / 5
Thumbnail

Discussion


Happy St. Patrick's Day - simple emoticon & animation demo
*Did you know you can use most emoticons in text objects?* Most emoticons are just <https://home.unicode.org/ unicode charac...

5 years ago | 6

Answered
Creating specific grid lines for heatmap
Heatmaps are difficult to customized since many of their handles and properties are hidden or undocumented. imagesc is a good al...

5 years ago | 5

| accepted

Answered
Problem using "datetime"
T = table(string(N), 'VariableNames', {'Dates'})

5 years ago | 0

| accepted

Answered
Adding Second Callback to UIAxes Toolbar in App Designer
First, thanks for the interesting topic (+1). Here's a simpler way of issuing multiple actions when pressing the Restore toolba...

5 years ago | 0

| accepted

Answered
Cell array indexing in matlab
To access the last element of an array stored in cell array C at location {m,n}, y = C{m,n}(end); To access the last element ...

5 years ago | 0

Answered
Plot legend position changes between fig in live script and external window
The figure position when embedded in a live script is not the same as the figure position when undocked. Therefore, you shouldn...

5 years ago | 0

| accepted

Answered
save graph in video
Use F=getframe() to store an image of the plot for each iteration of the for-loop. Save F to file if you want to replay the mov...

5 years ago | 0

Answered
window size in matlab's app designer
From the component browser in AppDesigner, select the figure handle and check the Window Appearance & Position properties in the...

5 years ago | 1

Answered
Problem with XVariable property in stackedplot
Here's an undocumented hack that adds a listener that responds to changes to the x-label at the top of the vertical reference li...

5 years ago | 1

| accepted

Discussion


New in R2021a: Capture disp() output as a string
We've all been there. You've got some kind of output that displays perfectly in the command window and you just want to capture...

5 years ago | 10

Answered
using contour plot to solve the problem
I assume you have an n-by-m matrix of costs for n heights and m radii. I'd use heatmap or imagesc to create a gridded color d...

5 years ago | 0

Answered
audio recording issue with wavrecord function matlab 2020
The error message tells you the problem. error: Unrecognized function or variable 'wavrecord'. Matlab doesn't know what wavre...

5 years ago | 0

| accepted

Answered
Write a MATLAB function that returns the square of a number.
> Is it correct ? funciton square = sqr (x) square = x * x; end Feedback "function" is spelled incorrectly which I'm su...

5 years ago | 2

Load more