Answered
Is there a limit to the number of elements in an array in Matlab
Check again, if you are really reading the file your expect you do. Use absolute path names to control this. If the file starts...

6 years ago | 0

| accepted

Answered
Number to String Conversion Inaccuracy
Matlab uses the default type double, which is defined by the IEEE 754 standard. This type is implemented in the CPU hardware als...

6 years ago | 1

Answered
How to move files to one level up and append the name of the folder in which they are contained?
BaseFolder = 'myFolder'; FileList = dir(fullfile(BaseFolder, '**', '*.vtp')); for iFile = 1:numel(FileList) File = F...

6 years ago | 0

Answered
MatLab multiple functions question
The instructions ask for: "The output argument should be a Boolean variable". Your function IsLeapYear does not reply anything y...

6 years ago | 0

| accepted

Answered
Array inside an array
The elements of a matrix cannot be a matrix again. But you can insert the elements, such that the array grows: x = 1:3; y = 7:...

6 years ago | 1

Answered
loop: stop if value repeats
N = Number; G = Guess; x = 1:N; R = nan(1, N); found = N; for k = 1:N R(k) = mod(G^x(k), N); if any(R(1:k-1) == R(...

6 years ago | 1

| accepted

Answered
How do I make my for-loop control the signs (+/-) of two variables ("x1hat" and "x2hat") for each loop?
A simplification: if (x1hat(n) >= 0) == (x2hat(n) >= 0) ... else ... end Avoid unnneded square brackets or parenth...

6 years ago | 2

Answered
Axes OuterPosition going nuts
When do you get these output position values? Before a drawnow or afterwards? Please check again, if you are really checking th...

6 years ago | 0

Answered
2D logical indexing of 1D array for resulting 2D array
A = {'A'; 'B'; 'C'}; ind = logical([1, 1; 0 0; 0 1]); indD = double(ind) .* (1:numel(A)).'; % Auto-expand, >= R2...

6 years ago | 1

| accepted

Answered
how do u make a new value that is the sum of two columns
A = [1 2 ;3 4; 5 6 ;7 8; 9 10; 11 12; 13 14; 15 16]; B = A * [0.6; 0.4]

6 years ago | 0

Answered
How can do this?
n = []; while 1 x = input('Enter a positive number: ') if x < 0 % or <= ? break; end n = [n, x];...

6 years ago | 0

| accepted

Answered
Out of memory issue
What is freq0? For j=2 the time span is: T = [0 200000] / 1 % This is [0, 2e5] In [t,y]=ode45(@(t,y)driven_fre(t,y,tau,De...

6 years ago | 1

Answered
Saving data of command window from callback function
function data = displayCharacteristicData(src,~, Flush) persistent Store if isempty(Store) Store = struct('v1', [], 'v2',...

6 years ago | 0

Answered
extract from structure data with a field with the same value
match = strcmp({A.type}, 'type1'); % Logical indices idx = find(match) % Indices value = [A(match).par1] ...

6 years ago | 0

| accepted

Answered
why didn't the event function detect the events?
Just my standard interjection: Matlab's ODE integrators are designed to integrate smooth functions. Your function Tq_Tj() conati...

6 years ago | 0

Answered
Low pass filter VS high pass filter
On first view you see, thet the high frequencies are removed: the changes between neighboring values are reduced. This means tha...

6 years ago | 1

Answered
Maximum number of repeated values over an array
With FileExchange: RunLength : a = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0, ... 5,0,0,0,0,0,0,0,0,0,0,0,...

6 years ago | 0

Answered
How can i count how many time a number appears and for how long in a vector?
Start with a run-length-encoding, e.g. by FileExchange: RunLength . If you do not have a C-Compiler installed, use RunLength_M o...

6 years ago | 0

| accepted

Answered
Assembling two matrices into one in a given pattern
A bold guess (although a wrong guess might be more confusing than posting nothing): A = [1 2; 1 2]; B = [2 3; 2 3]; [s1, s2...

6 years ago | 0

Answered
Array indices must be positive integers or logical values.
What is z1 and z2? Are these vectors? Then the message means, that z2((x(a)-x0)^2/z2^2+1) is not a valid expression, because ...

6 years ago | 1

Answered
2D Interpolation with different sized matrices
A bold guess of what "corresponding x value when the y and z values are provided" means: x = [1 2 3 4 5]; y = [1 2 3 4 5]; z ...

6 years ago | 0

Answered
How to append for each iteration?
hournum = 10; projectlength = 3; yield = cell(1, projectlength); % Pre-allocate as cell helper = zeros(1, hournum); % P...

6 years ago | 0

| accepted

Answered
Functions in If Statements
This: for n = 1:FMn %cycle through files in the directory finalname = FMdir(n).name; end does the same as: finalname = ...

6 years ago | 0

Answered
How to code sparse diagonal matrix of increasing dimensions
Maybe this is not, what you want: for n = 500:50:1000 tic t1(n) = toc; end Setting t(500) in the 1st step ist not u...

6 years ago | 0

Answered
line and column of the minimun element of a matrix
m = [5 1 -400; ... -6 100 -6; 2 5 25]; [~, ind] = min(m(:)); [row, col] = ind2sub(size(m), ind) Or: [v, ind1]...

6 years ago | 1

| accepted

Answered
Problem with changing visibility of pop-up list
What is the purpose of: % Update handles structure guidata(hObject, handles); For some unknown reasons the value ...

6 years ago | 0

Answered
If else conditionals in matlab app.designer?
if strcmp(app.menu.Value, 'ac') && ... or define the values as string with double quotes, not as "cell string", which...

6 years ago | 0

Answered
Min and max value of many results
Use a vectorized method to obtain the results as a vector, not as a bunch of single variables: w = 0:0.001:1.393; k = 2; ...

6 years ago | 2

Answered
Unrolling a 20x20 grid of pixels into a 400 dimensional vector.
If the data are a collection of 500 matrices of the size 20x20: data = rand(5000, 20, 20) You can create the 2D matrix by: da...

6 years ago | 0

Answered
what is the probleme exactly u must be of size[3,20] but i find it [3,1]
Let me guess boldly: You want: A = [5/8, -1/4, 1/8; 1/4, 0, 1/4; 1/8, -1/4, 5/8]; b = [1;-1;1]; u = [5; 2; -4]; m = 20; u =...

6 years ago | 0

Load more