Answered
Normalize columns of matrix with complex data?
array = array ./ ( sum( ( array .* conj(array) ).^2 ) ).^0.25

9 years ago | 0

| accepted

Answered
How to set colour on 3d graph depending on data
cmap = [1 1 1; 0 0 0]; colormap( hAxes, cmap ) You will also need to make sure you have a symmetric colour axis though u...

9 years ago | 0

Answered
How to compare function handles?
doc func2str will give you a string representing your function that you can compare, but it depends how complex your functi...

9 years ago | 0

Answered
Listbox with hierarchical levels
You can use uitree or the underlying java representation, but it isn't documented. <http://undocumentedmatlab.com/?s=tree>

9 years ago | 0

Answered
How to increase the size of a GUI canvas in Matlab?
Double click the figure (i.e. anywhere not on one of the other components) and enter a number in the 'Position' field for width ...

9 years ago | 1

| accepted

Answered
Adding values in a matrice?
If you just define your values you want to add in a single 6*4 matrix instead of creating 6 un-necessary variables you can just ...

9 years ago | 0

Answered
Function does not return value when nested
Callback functions cannot return arguments. Since it is a nested function though it shares the workspace of the parent functi...

9 years ago | 0

Answered
To change data displayed by data cursor in 3d scatter graph.
dcm_obj = datacursormode(figure_handle); returns you the object that controls the datacursor. Then when you have this, you...

9 years ago | 0

Answered
How can I make an array of bars like I have this array of lines?
bar returns an object that represents the whole series of bars in an object if you give it a vector as input so there is only 1 ...

9 years ago | 0

| accepted

Answered
switch case - choose from array
validIdx = ismember( 1:10, [1 5 12 14] ); for n = 1:numel( validIdx ) if validIdx(n) disp( 'k is an opti...

9 years ago | 1

Answered
using slice command on a cube matrix
Just use x = 1:29, y = 1:21, z = 1:44 if you don't care what the x, y and z values are - these will give you the indices into th...

9 years ago | 0

Answered
product of sum of the elements along the fourth dimension in a 4D matrix
a = ones( 3, 4, 5, 6 ); b = sum( a, 4 ); c = prod( b, 3 ); seems to do the job

9 years ago | 0

Answered
Why fprintf('%3.1f',round(-eps)) prints -0.0?
<https://uk.mathworks.com/matlabcentral/answers/91430-why-does-fprintf-put-minus-signs-in-front-of-zeros-in-my-file?s_tid=answer...

9 years ago | 1

Answered
Rare examples of confusing error messages
<</matlabcentral/answers/uploaded_files/67699/MatlabError.png>> was one I got the other day. Not sure what I had done to get...

9 years ago | 1

Answered
>>root([1 -1 -2]) for a polynomial is not working.
There is no 'root' function in Matlab or its toolboxes that I am aware of. doc roots is a function, but you have hidden ...

9 years ago | 2

Answered
update instance property data without creating a new object?
x = x.updateA(10) will update the current object. Or you can derive your class from 'handle' to make it a pass-by-refere...

9 years ago | 0

| accepted

Answered
How can I divide the plot to the two levels (upper and lower) with different y range data?
doc yyaxis if you are using R2016a or later. doc plotyy if not. With these you can define the left and right axes ...

9 years ago | 0

Answered
Delete row based on criteria of 2 variables
A( A(:,6) > B, : ) = [];

9 years ago | 1

| accepted

Answered
read only time from date
[Y,M,D,H,MN,S] = datevec(___) seems like it would do this, more information in doc datevec

9 years ago | 0

Answered
Using repmat instead of subplot - adding grid lines and points
If you know the size of your images then can't you just use a standard plot command e.g. A = [rand(100) rand(100) rand(1...

9 years ago | 0

| accepted

Answered
How to open current working directory if a certain folder doesn't exists in the directory?
if exist( folder, 'dir' ) will test if a folder exists or not on the file system. Judging by your attempts at it though I'...

9 years ago | 1

Answered
i have a problem in converting my GUI based matlab code into exe file using deploytool ... below is error which gives during compiling. thanks in advance
Do you have a license for the compiler? That error is from the licensing, telling you it cannot checkout a license for the 'com...

9 years ago | 0

Answered
Trouble with subplot size
What is the result of which subplot ? This is an error you would get if you have a variable of the same name as the f...

9 years ago | 0

| accepted

Answered
Plotting a graph of a date !!
'Oct 1991' and 'Sep 1992' are not a valid format for a date string so these get interpreted totally differently to what you e...

9 years ago | 1

| accepted

Answered
How do i extrapolate the points of intersection?
x = 1:18; y = [0 0 10 10 20 30 100 100 110 95 70 60 56 100 100 97 60 30] d = diff( y > 90 ); idx = find( d );...

9 years ago | 0

Answered
Is there a way to exclude a segment of the code from the coder?
e.g. if coder.target('MATLAB') error( 'SomeError:Id', 'This is an error not supported by Coder' ); end

9 years ago | 2

| accepted

Answered
fix window size for circle plot?!
doc axes properties Take a look at the sections on: DataAspectRatio PlotBoxAspectRatio I can't remember off ...

9 years ago | 0

Answered
k_means.m body
I assume it is this file exchange code: https://uk.mathworks.com/matlabcentral/fileexchange/50426-fuzzy-k-means-clustering/...

9 years ago | 0

Answered
How to limit an input within a specific range?
u = min( someMax, max( someMin, u ) );

9 years ago | 0

| accepted

Load more