Beantwortet
Why did I get the same value from radio button in a buttongroup?
You are always asking for the Selected object's 'Value'. This will always return 1 because it is the selected object. You sh...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
GUIDE - How to use variables that are calculated in Button 1, in Button 2?
<https://uk.mathworks.com/help/matlab/creating_guis/share-data-among-callbacks.html> This gives various different methods and...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
Find indices of points in meshgrid-like data
[~, index] = ismember( A, [X(:) Y(:)], 'rows' ); Not sure if that is any faster than a loop though. ismember is not a very...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
How to reshape a cell array ?
cellfun( @(x) x + zeros( 95, 1 ), ESS_estimated_schedule, 'UniformOutput', false ); It seems like rather large replication ...

mehr als 7 Jahre vor | 0

Beantwortet
How to Change the Fill Color of the Box in a Box Plot?
Unfortunately boxplot seems to be one of those unpleasant plotting functions that returns nothing and gives you no easy way to c...

mehr als 7 Jahre vor | 1

Beantwortet
how do i change units of xaxis and yaxis without changing the plot??
If you are using a sufficiently new Matlab then you can use hAxes.XAxis.Exponent = 0; for an axes handle, hAxes, to get ...

mehr als 7 Jahre vor | 0

Beantwortet
How to catch warnings?
<https://undocumentedmatlab.com/blog/trapping-warnings-efficiently> may help with this. Credit to Guillaume from <https://uk...

mehr als 7 Jahre vor | 4

| akzeptiert

Beantwortet
Determining whether an angle is between two other angles
RayCat = sign( az_ray - mod( gamma1, 360 ) ) == sign( mod( gamma2, 360 ) - az_ray ); looks like it would do the job.

mehr als 7 Jahre vor | 1

Beantwortet
how to insert the workspace near the editor?
On the Home ribbon there is a 'Layout' dropdown list about 2/3 of the way along. Tick 'Workspace' on its list and then you can ...

mehr als 7 Jahre vor | 1

| akzeptiert

Beantwortet
Scrollable checkboxes inside uipanel GUIDE
You can't do it with a simple Matlab component, but you can use 3rd party scrollable panels or write your own if you really want...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
How to divide every column of an array with another column of the same length?
res = Y ./ S;

mehr als 7 Jahre vor | 1

| akzeptiert

Beantwortet
How do I color points from scatter3 (3D scalar field), in accordance with their scalar values?
I don't have time to give full code, but the first option gives you what you need - i.e a single scatter3 instruction, not a mas...

mehr als 7 Jahre vor | 1

| akzeptiert

Beantwortet
How to show all decimals in axis?
ax.YAxis.Exponent = 0; should do this if you have a sufficiently recent version of Matlab.

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
How to make a box for comments in Matlab GUI?
uicontrol ( ... 'Units', 'pixels',... 'Position', [0 0 200 200],... 'Style','edit',... 'FontName', 'arial'...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
Cannot Break A Function Loop With GUI Button
The attached files give an example of a start-stop GUI which works relatively simply. Don't use global variables to pass data a...

mehr als 7 Jahre vor | 0

Beantwortet
How to vary the color according to the data ?
<https://uk.mathworks.com/matlabcentral/answers/5042-how-do-i-vary-color-along-a-2d-line This answer> may help.

mehr als 7 Jahre vor | 0

Beantwortet
Why do nested means give different answers depending on which dimension is averaged first
It is just rounding errors. When I tried your code the offsets were of the order of 1e-16, which is close enough to 0 as to mak...

mehr als 7 Jahre vor | 1

| akzeptiert

Beantwortet
tmp_1(tmp_2 > 0) What does this command mean in Matlab?
tmp_2 > 0 is a logical result of the same size as tmp_2 which is true where tmp_2 is greater than 0 and false otherwise. ...

mehr als 7 Jahre vor | 0

Beantwortet
Most efficient way to generate an array around a central value
[ flip( center:-stepsize:lower ), ( center + stepsize ):stepsize:upper ]; looks like it would work, though I haven't tested...

mehr als 7 Jahre vor | 0

Beantwortet
Matrix dimensions must be agree
size( repmat(x, [m 1]) ) size( repmat(mu, [1 n]) ) on the command line will quickly show you the problem. The first is ...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-2.
Your timestep function returns this: Population_variables=[C,V]; Yet you call it twice as: V = timestep(C,V,delta_t...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
phase value are in range of 0 to pi. how can i convert them to range of 0-256
Surely just the obvious: result = input * 256 / pi; works? Where obviously input is your data from 0-pi and result is w...

mehr als 7 Jahre vor | 0

Beantwortet
plot the relationship between function and specific variable
a=0.2; b=0.3; thada= 0.1:1:20 tf = zeros( size( theta ) ); for n = 1:numel( thada ) t=[1+(((thada( n...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
Convert structure to vector
vertcat( M.vector )

mehr als 7 Jahre vor | 2

| akzeptiert

Beantwortet
Getting "Subscript indices must either be real positive integers or logicals" error from simple calculation
You can just do an online search for floating point arithmetic or similar phrases and you will get links like, e.g <https://e...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
How i create a matrix from a nested loop?
A = zeros( 25, 2 ); for i=1:5 for j=1:5 idx = 5 * ( i - 1 ) + j; A(idx,:) =[i, j]; end ...

mehr als 7 Jahre vor | 0

Beantwortet
why can't i plot 2d graph with this equation ? Can anyone help me with this ? thank you.
y is a scalar, x is a vector. y needs to be the same size as x to see a meaningful plot. Alternatively you need to give a mark...

mehr als 7 Jahre vor | 0

Beantwortet
Save a matrix in MATLAB
save( filename, 'matrixName' ) e.g. myMatrix = rand( 100, 100 ); filename = 'C:\Stuff\Somefile.mat'; save( f...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
What those permute numbers mean?
They are the order of permutation of the dimensions, as described in doc permute So after the permutation what was the 3...

mehr als 7 Jahre vor | 0

Beantwortet
Removing Elements from an Array based on their Position for every 3 Elements
If you are using R2015a or later then this will work: elements_n = repelem( elements_n, 3 ); Arr( Arr == elements_n ) = ...

mehr als 7 Jahre vor | 1

| akzeptiert

Mehr laden