Answered
Unable to perform assignment because the left and right sides have a different number of element
K(n, :) = A; % ^ L(n, :) = A; % ^ The vector A can be assigne to the vector of the array K and L only. K(n) is a sca...

5 years ago | 0

| accepted

Answered
Detecting common points in 2 images segmented
Common = Image1 & Image2;

5 years ago | 0

Answered
Error: Function definition not supported in this context. Create functions in code file.
How do you call this function? This would be working: [x,y] = solo(a,b,c,d) Do you include a "function" in this call?

5 years ago | 1

| accepted

Answered
plot with light to dark blue colour
x = rand(10, 20) + (1:10).'; figure; axes('NextPlot', 'add'); color1 = [0.5, 0.5, 1]; % Set colors according to your def...

5 years ago | 2

Answered
cannot launch a GUI which works previously
How large is your screen? Reset the position property: rmpref('uipickfiles', 'figure_position')

5 years ago | 1

| accepted

Answered
Converting serial date to regular dates
plot(data_all(:,1), data_all(:,2), '-r'); datetick('x')

5 years ago | 1

Answered
any suggestion to store answer after for loop into a matrix to use later?
x = 0:N; b = zeros(ceil(log2(N)), length(x)); % Move this BEFORE the loop to avoid overwriting for d = 1:N p = 0; w...

5 years ago | 0

| accepted

Answered
How can I interpolate just one point on a given function while saving time?
3 times faster without overhead, if you fokus on the neighborhood: X = -360:0.5:359.5; Y = rand(size(X)); xi = 7.59; tic fo...

5 years ago | 0

| accepted

Answered
Non Click away figure MATLab R2019b
You can set the figure's WindowsStyle to "modal": figure('WindowStyle', 'modal') With https://www.mathworks.com/matlabcentral/...

5 years ago | 0

| accepted

Answered
Understanding function written in a book
z = fzero( @( z) cdf( 'norm',z,0,1) -( 1-.95) ,0) % Simplify: z0 = fzero(@(z) cdf('norm', z, 0, 1) - 0.05, 0) fzero locates...

5 years ago | 0

Answered
Removing zeros from rows of a cell matrix
C = C(cellfun('isclass', C, 'char'))

5 years ago | 0

| accepted

Answered
problems with the computational speed of a sliding kernel window
Do not start serious code with "clear all". This removes all loaded functions from the memory and the reloading from the slow di...

5 years ago | 2

| accepted

Answered
Labelling columns of large array in a searchable way?
vnames{ii} = [num2str(ii) '_' num2str(tag(ii))]; This hides the tags in the names of the variables. This complicated method re...

5 years ago | 0

Answered
Callback function not found for dynamically created app UI component
As far as I can see, Matlab searchs for a matching function with the input (app, event), but your callback accepts (app) only. S...

5 years ago | 0

Answered
Howto store the value in 'for loop' to be compared in the next iteration
Exactly as you have written it as text: "if the value obtained is less than the previous value, i have to replace it with the ne...

5 years ago | 0

| accepted

Answered
Getting the x from a function file to call inside another function file
The reliable way to provide the values of variables defined inside a function is to export them as output arguments. If they are...

5 years ago | 0

| accepted

Answered
How can I replace numbers in a vector with strings stored in a csv file?
Import the strings from the CSV file and use either the values of your vector as index. Or use the 2nd output of ismember() to f...

5 years ago | 1

| accepted

Answered
How to extract variable from a function file while using ode45?
This question is asked several times per day. I ask MathWorks to include an explanation in the documentation. Yes, of course it...

5 years ago | 0

| accepted

Answered
Error messages using bvp4c
res = [f0(1) f0(2) finf(2) -1] The 1st and 2nd row contain 1 element, the 3rd row contains 2 elements. Be caref...

5 years ago | 0

Answered
Error using feedforwardnet (line 72) FCN does not return an info object.
According to the documenation: https://www.mathworks.com/help/deeplearning/ref/feedforwardnet.html#mw_85a847e7-13dd-45fd-b7b9-06...

5 years ago | 0

Answered
1st order The ODE
Of course. Either use one of the other integrators, e.g. ode15s. Although it is designed for stiff ODEs, you can process nin-sto...

5 years ago | 0

| accepted

Answered
Error while evaluating UIControl Callback from a checkbox on a figure
USe the debugger to check the cause of the problem. Type this in the command window: dbstop if error Run the code again. When ...

5 years ago | 0

Answered
how to solve this: Unable to perform assignment because the size of the left side is 1-by-48 and the size of the right side is 0-by-0. How can I make the right side like the left side for this {u(1,:)=2*ON*abs(cns-action); }
Check this by using the debugger. Type this in the command window: dbstop if error and run your code again. When it stops, che...

5 years ago | 0

Answered
Two cells merged together with different conditions
a = {'A'; 'B' ; 5 ; 6; 'A' ; 'A'; 'B'}; b = { 7; 'B' ;'A' ;'B'; 'A' ; 'B' ; 'A'}; c = cell(size(a)); % Pre-allocation is...

5 years ago | 1

| accepted

Answered
Cannot Install MATLAB on my windows 10 laptop
Did this help: https://www.mathworks.com/matlabcentral/answers/93297-why-does-the-mathworks-installer-fail-to-start-on-windows

5 years ago | 0

Answered
Never ask to save after modifying pathtool
You can create your own tool, which uses addpath and savepath automatically. I usually use these commands in the command window ...

5 years ago | 0

Answered
How to apply formula with if statement
You did not show with which input you call your function. You mention, that there is a difference, but we cannot guess, which va...

5 years ago | 1

| accepted

Answered
vector of random numbers - mean, MSE / SSE.
Use mean() to calculate the mean. Then MSE is the "mean squared error": mean((b - mean(b)) .^2). There is no magic. Simply try...

5 years ago | 0

| accepted

Answered
How to calculate the mean of all neighbouring elements in a matrix
What about: M = [3,4,8,6; 1,6,9,0; 2,5,7,1]; Result = movmean(movmean(M, 3, 1), 3, 2); Or: n = 3; % Window size [s1, s2] ...

5 years ago | 0

Load more