Answered
Making a function out of a script
Creating variables with names like "A_2017_05_01" is a really bad idea. Hiding important information in the *names* of the varia...

9 years ago | 0

Answered
Fast rewrite all values in a large matrix.
A(:, x:y) = group; is faster than creating the index vector before. See <http://www.mathworks.com/matlabcentral/answers/356...

9 years ago | 1

| accepted

Answered
Comparision of data names
t = {files.name}; [Lia, Locb] = ismember(CellArray, t); Or perhaps: [Lia, Locb] = ismember(CellArray(:, 1), t); May...

9 years ago | 0

| accepted

Answered
"butter" filter: Undefined function
The error message means, that you do not have the Signal Processing Toolbox, which is required for the |butter| command. But you...

9 years ago | 2

| accepted

Answered
Hello.. how to solve this error??
The error message is clear. * either combF2 is shorter than s2-2 in the 2nd dimension * or combFpick does not have j element...

9 years ago | 0

Answered
Need to create a moving image in desired trajectory
See <https://www.mathworks.com/matlabcentral/answers/101034-how-can-i-add-a-moving-image-to-a-plot-in-matlab-7-1-r14sp3> . I ...

9 years ago | 0

Answered
problem in calculating mean from the required element of matrix??
index = find(mat6 > 0.5, 1); % Find 1 index only mea = mean(mat6(index:index+19)); Consider that |index+19| might exc...

9 years ago | 1

Answered
Why did Matlab 2016b crash?
Did you see and consider this part of the message already: If this problem is reproducible, please submit a Service Request ...

9 years ago | 0

Answered
Plotting subplot in real time Problem
xlim([time(count)-scrollWidth time(count)]) This updates the X-limits of the current axes. If you only set the XData of an ...

9 years ago | 1

| accepted

Answered
How to get indices of a matrix of numbers?
With <https://www.mathworks.com/matlabcentral/fileexchange/41813-runlength>: Data = [1 0 0 4 0 1 2 0 0 0 0 0 0 4 2 22 41 ...

9 years ago | 1

Answered
Markers have white boxes over them when printed to png file
What happens, if you limit the axes limits at first? AxesH = axes('xlim',[0 250],'ylim', [0 8], 'NextPlot', 'add'); draw...

9 years ago | 0

Answered
Help with a for-loop of an array of iterative matrices
Hiding indices in the name of a variable is a bad idea. See <http://www.mathworks.com/matlabcentral/answers/304528-tutorial-why-...

9 years ago | 1

Answered
How to give ode45 just 1 time step?
ODE45 is an integrator with a step size control, which adjust the steps to satisfy the demands for accuracy. This helps to find ...

9 years ago | 0

| accepted

Answered
Saving imported date to a new file
Storing numbers in ASCII files is only useful, if you want to edit the files manually. Prefer binary files, because they are sma...

9 years ago | 0

Answered
C++ Source Code to MATLAB
Integrating some C++ code in a mex file is not hard: The mex file is started at the entry function "mexFunction". In tis functio...

9 years ago | 1

| accepted

Answered
Could anyone please help me to code this problem.
M = [1;2;3;5;7;7;9;10;11;11;12;13;16;16;22;22;23;23;23;44;45;65;103;113]; maxtop = [7, 12, 24]; Result = cell(1, numel...

9 years ago | 0

Answered
how define a conditional handle function?
A function (see Torsten's answer) will be nicer and more efficient than an anonymous function. But if you realy have any good re...

9 years ago | 0

Answered
Is it possible to determine when I last used a toolbox?
You could check the file access dates with <https://www.mathworks.com/matlabcentral/fileexchange/24671-filetime FEX: GetFileTime...

9 years ago | 1

Answered
How do I disable a pop-up command window error when I run the compiled exe?
Error messages are important information. Avoiding them is a good idea. To do this remove the cause of the error. The error mess...

9 years ago | 0

Answered
Exporting data from struct 1x17 cells
fnames = dir('*.mat'); numfids = length(fnames); vals = cell(1,numfids); for K = 1:numfids data = load(fnames...

9 years ago | 0

Answered
How to save variables from output of function as vector?
Perhaps like this: function [A, B] = GetText(filename) fid = fopen(filename, 'r'); x = textscan(fid,'%n%s','headerlin...

9 years ago | 0

Answered
Why the external dos command/program is so slow in 64 bit window?
This can depend on "cd .". If the current directory contains 7000 files and is on a network drive connected by a 100MBit etherne...

9 years ago | 1

Answered
How can I store 10 different variables in a single row vector in workSpace throught editor Window ?
Instead of polluting the base workspace with different variables, better store the values inside the figure. Search in this foru...

9 years ago | 0

Answered
Create struct before function or in/with function?
The 2nd version is nicer, in my opinion: * Version 1 receives a struct with the wanted fields, which have been create in the...

9 years ago | 1

| accepted

Answered
Can you use DIR to list files in subfolders ?
In modern Matlab versions: files = dir('D:\Data\**\*.mat')

9 years ago | 66

Answered
I need to plot a function and i don`t rly know how , someone could help me with it , please?
w_t = linspace(0, 20, 200); F = 1 - exp(-w_t) - 1.1546 * exp(-w_t / 2) .* sin(0.866 * w_t) plot(w_t, F); Or if you ...

9 years ago | 0

| accepted

Answered
How to detect the signal start to fluctuate
It depends on how you define "start to fluctuate" mathematically. There are reasons to claim, that the signal fluctuates at the ...

9 years ago | 0

Answered
Error in executing a simple matlab function
Perhpas all that is missing is the continuation operator: W = W+ k*[cos(sqrt(2)*t(n))+cos(sqrt(3)*t(n))+1/(1+t(n)^2)-(1/(1+...

9 years ago | 0

Answered
How to find minimum value in column in a 5x5 matrix with only one value per row allowed
Perhaps: A = [82 73 74 63 49; ... 20 65 19 78 44; ... 40 45 69 58 45; ... 17 55 18 93 31; ... ...

9 years ago | 1

| accepted

Answered
error while compiling matlab file
|mu1| is used before it is defined. What is the prupose of: real(mu1) = -log(1.3); imag(mu2) = log(1.8); ? |real()| i...

9 years ago | 0

| accepted

Load more