Answered
Break loop with button click Appdesigner GUI [Both plot and button are in different callback functions]
function main FigH = figure; ButtonH = uicontrol(FigH, 'Style', 'PushButton', 'String', 'Stop', 'Call...

6 years ago | 1

| accepted

Answered
Why Index exceeds the number of array elements (1) if I change the input order in the anonymous function?
ode45 calls the function to be integrated as f(t, Y) . So the time must be the first input.

6 years ago | 1

| accepted

Answered
Extract rows from 2 different matrices with different dimensions using If statement
if AR(:,5)==n; This is a vector in the condition. Therefore Matlab inserts an all() implicitly, because conditions of if statem...

6 years ago | 1

| accepted

Answered
inputdlg does not work Matlab 2020a
User the debugger to find out more details. Type in in the command window: dbstop if caught error Now run the code again and c...

6 years ago | 1

Answered
if statement/numel (A)
These condition does not do, what you expect: 1<=(i + a)<=numel(A) 1<=(i - a)<=numel(A) They are evaluated from left to right...

6 years ago | 1

Answered
How to find euclidean distances between cell entries of two RGB matrices?
A = rand(47, 47, 3); B = rand(1, 456 3); AB = reshape(A, 47*47, 1, 3) - B; Dist = vecnom(AB, 2, 3); And now you want to fi...

6 years ago | 0

Answered
How do I use characters with an if statement?
Prompt = 'Please press any key to roll the dice, press Q or q to quit program: '; str = input(Prompt, 's'); if strncmpi(str...

6 years ago | 1

| accepted

Answered
Random draw without re-delivery in a loop
What are your input data? A list of files stored in a folder? (As usual: please explain this instead of letting the readers gues...

6 years ago | 0

| accepted

Answered
search in large cell file
In the loop all lines are stored in the cell an the loops stops, if the last one was not a CHAR. This means, that the last eleme...

6 years ago | 1

| accepted

Question


MEX api and interleaved complex arrays
Does MATLAB store complex data in interleaved format since R2018a? If you compile a MEX function with the -R2018a flag, you can...

6 years ago | 1 answer | 0

1

answer

Answered
Reversible matrix in matlab
You want to identify a "regular matrix and non-singular matrix". Then testing only, if it is square and not a zero matrix ist no...

6 years ago | 0

Answered
Calculation precision changed in 2020b?
The ACOS function is numerically instable at 0 and pi. SUM is instable at all. A trivial example: sum([1, 1e17, -1]) .There are...

6 years ago | 2

Answered
Why stock DOT function is suboptimally implemented
Just a comment: Under Matlab 2018b, Core i5-3320M CPU @ 2.60GHz: Elapsed time is 0.249669 seconds. dot(z,z) Elapsed time is ...

6 years ago | 0

Answered
How to concatenate matrices to calculate mean
As Steven has mentioned already, this is the main problem: "I have 40 matrices DJF1979_1980_125 to DJF2019_2020_125" Do not us...

6 years ago | 0

Submitted


ScaleTime
Fast linear interpolation of equally spaced data (C-MEX and M)

6 years ago | 2910 downloads |

5.0 / 5
Thumbnail

Answered
How to read data from a file into cell array keeping indents undisturbed
% Import file: Str = fileread('file.ext'); % Remove trailing line break to avoid appending an additional empty line: if ~is...

6 years ago | 0

| accepted

Answered
Not enough input arguments error
What about replacing: for j= 1:N if x(j)<beta1 & x(j)>beta2 f(1,j)=f02(x(j)); end if x(j)>beta1 & x(j)<...

6 years ago | 0

Answered
command window no output
Check if you have shadowed the display function: w = cellstring(which('display', '-all')); fprintf('%s\n', w{:}) What do you ...

6 years ago | 0

Answered
Find string in the special file
S = fileread('R2_AS - Copy.txt'); i1 = [strfind(S, 'Szenario'), Inf]; i2 = strfind(S, 'has been created.'); width = numel(...

6 years ago | 0

Answered
Namelengthmax value in different operating systems
The value of namelengthmax depends on the Matlab version only. It is the same for all operating systems. Identifiers can have ...

6 years ago | 0

Answered
Syntax Error using Fcn Block
You need round parentheses for indexing, not square brackets: (1/Mus)*(Ks*(u[3]-u[4])+Ct*(u([7]-u[2])+Kt*(u[6]-u[4])-u[5]) % =...

6 years ago | 0

| accepted

Answered
how to compute the number of image from subfolder ?
fullfile(('.\databasee\')) is exactly the same as its input: '.\databasee\'. The unnecessary parentheses are confusing only. To...

6 years ago | 1

| accepted

Answered
Different machine precision for scalars and vectors?
The only difference is the display in the command window. Matlab tries to display vectors in an abbreviated format, execpt if yo...

6 years ago | 1

| accepted

Answered
Strange behavior of the editor in the forum
1.5 years later. I tried it again. I still cannot set a flag, delete an answer or insert an image or link. Whenever I try it, t...

6 years ago | 2

Answered
Combining 2 codes to make a number counter with user input
function v = Sample() Loop = true; Count = 0; v = []; while Loop a = input('Please input a number: '); if a >= ...

6 years ago | 0

Answered
regarding 'FOR LOOP' use to plot discrete impulse response
The question is not clear yet. Do you mean: delay = repmat(1, 1, 500); amplitiudes = repmat(0.1, 1, 500); % Alternati...

6 years ago | 0

Answered
How can write loop for this algorithm?
I'm not sure, because the question is not completely clear to me. Perhaps: A = [1 1 2 2 3 3 3 4 4 8 9 10]; d = diff(A); v = f...

6 years ago | 0

Answered
counting number of textbox or patches in a matlab figure
% All text boxes: List1 = findall(HandleOfFigure, 'Type', 'uicontrol', 'Style', 'text') Count1 = numel(List1) % All patche...

6 years ago | 0

Answered
mlock not working, variables getting cleared in function switch.
Create this file: function demo(In) persistent v switch lower(In) case 'lock' mlock disp('locked'...

6 years ago | 0

Answered
nested k for loops for a parameter k
Start with simplyfying your code: Replace the 2 innermost loops: s = 0; for u1=1:2 for u2=1:2 s = s + t1(u1,v1,w1)*...

6 years ago | 1

| accepted

Load more