Answered
How can I use XTickLabel with a bigger font in a subplot
Problems occur, if the number of XTicks differs from the number of XTickLabels. So set both: a = 10*rand(1,5); b = rand(1,5); ...

5 years ago | 0

| accepted

Answered
How to generalize code with many cases (Matlab)
for ess = 1:n if ess == 1 Hc = H(1:T,:); else Hc = H(T:end,:); end k = (ess - 1) * 10 + ...

5 years ago | 0

| accepted

Answered
vertcat error while using splitapply
@max calculates the maximum over the 1st non-singleton dimension. If the input is a matrix, this is the first dimension, but if ...

5 years ago | 0

| accepted

Answered
maximum clique problem solve
With replacing if isempty(find(node==clique)) ... if isempty(find(clq(ii) == graph{node})) || isempty (find(node == graph{cl...

5 years ago | 0

| accepted

Answered
Shifting vectors with the same matrix using 'for' loop
I'm not sure what you want to achieve. Maybe you can post the wanted output created by hand? A bold guess: V = randi([0,1], 50...

5 years ago | 0

| accepted

Answered
Need help in looping a code for different values of tolerances
vTol = [10^-4, 10^-6, 10^-8, 10^-10, 10^-12]; for iTol = 1:numel(vTol) tol = vTol(iTol); iter = 0; xnew ...

5 years ago | 1

| accepted

Answered
error in reading csv file
Use the 'Format' option of readtable to import the time as string. Then remove the dots with strrep and convert the rest to a nu...

5 years ago | 0

Answered
Overall size of subplot figure after tiff export
Which Matlab version are you using? With R2018b your code produces a TIFF with the Print Size 3.30 x 7.00 inches, exactly as you...

5 years ago | 0

| accepted

Answered
histogram by not using the default imhist
Initially imhist is a command. Calling it as imhist(i) + 1 should cause an error. Do you get a corresponding message? Use a dif...

5 years ago | 0

| accepted

Answered
Changing values in matrix under certain condition
Displacement = max(Displacement, 0); Notes: sqrt(x) is 50% faster than x^0.5 [ ] is the Matlab operator for a concatenation...

5 years ago | 0

| accepted

Answered
How to stop overwriting?
Maybe: dd = cell(1, 4); for i = 1:4 url = data{i, 1}; dd{i} = listAllDirectories(url, folderCellArray, saveFileNam...

5 years ago | 0

| accepted

Answered
Change matrix bits depending on the rate (Matlab)
[s1, s2] = size(A); d = gcd(s1, s2); n1 = s1 / d; n2 = s2 / d; vCol = n2:n2:s2; for iCol = 1:numel(vCol) iRow = (iC...

5 years ago | 0

| accepted

Answered
comparision data in matlab
I have posted the code almost as you need it in your other question: [Common, iA, iB] = intersect(A(:, 1), B(:, 1)); A(:, 3) ...

5 years ago | 0

Answered
Not enough input arguments error in function
How do you call this code? Do you use the green triangle in the editor? Then the function is called without input arguments. See...

5 years ago | 0

Answered
Avast running in the background
Does Avast run also, when Matlab is in idle mode? Then Avast consumes ressources of your computer and this question has no relat...

5 years ago | 0

Answered
How can i calculate area under curve from CSV file.
Do you mean the swapped arguments for TRAPZ? Integral = trapz(ActivePowerANAvg, t) % [EDITED] No, this does not work CSV-Fi...

5 years ago | 0

Answered
a function generating a square matrix
This is not a matrix in Matlab, but invalid syntax: A = [11 12 13 14] [21 22 23 24] [31 32 33 34] [41 42 43 44] ...

5 years ago | 0

| accepted

Answered
Help with running a Monte Carlo please...and another question :)
See darovas comment: Do not hide indices in names of variables but use arrays instead. See also: https://www.mathworks.com/matla...

5 years ago | 0

| accepted

Answered
Index exceeds the number of array elements (11).
The message tells you, that you try to access W_S(12), but W_S has 11 elements only. This means that W_S = [12.995 : W_delta_S...

5 years ago | 0

| accepted

Answered
Create sub-matrix respecting an order
A = [1 7 9 8; 4 16 12 3; 5 22 14 8; 1 10 27 2] C = mat2cell(A, [2,2], [2,2]) Now the 4 matrices are C{1} to C{4}, or if you wa...

5 years ago | 0

| accepted

Answered
How to change all the white pixel into the rgb version of its original picture
Image2 = cat(3, BW2 .* i(:, :, 1), BW2 .* i(:, :, 2), BW2 .* i(:, :, 3)]; Or in modern Matlab versions sind R2016b with auto-ex...

5 years ago | 0

Answered
What does this warning mean?
This means, that you have instructed Matlanb to use the last working folder (the folder replied by the cd command) is used as in...

5 years ago | 0

| accepted

Answered
The Matrix Variable Problem
You must use ones or zeros sounds, like you should use one of these commands. Then read their help text: help ones help zeros ...

5 years ago | 1

| accepted

Answered
Comparison of two unequal length files.
Import the files. (Is this a part of your problem?) Search the intersection of the common variable with the command intersect ....

5 years ago | 1

| accepted

Answered
Figure size when run from task scheduler
Is this really your code? My_Plot = figure('visible','off','Renderer','Painters', ... 'Position','[1 41 1920 ...

5 years ago | 0

Answered
Compacting the code by using an for loop or maybe an struct?
You do not need the initial loop. Easier: moved = ([Participant.GKMovement] == 0); GKLateKickDep = Participant(m...

5 years ago | 0

Answered
How to resolve garbled characters when reading a text file created in Windows.
Please piost your code. "Use FOPEN" or "tried to specify the character encoding" does not reveal the details. This shows, that y...

5 years ago | 0

| accepted

Answered
Loading in Multiple Excel Files using readmatrix
Folder = 'C:\Your\Folder'; for k = 101 : 105 filename = fullfile(Folder, sprintf('%d.xlsx', k)); data = readmatrix(...

5 years ago | 1

Answered
How to make calculations between two specific files via loop?
Folder = 'C:\Your\Folder'; XLSList = dir(fullfile(Folder, '*.xlsx')); TXTList = dir(fullfile(Folder, '*.txt')); TXTName = {T...

5 years ago | 0

| accepted

Answered
For loop not working
The loop does run over all T. Why do you think, that the loop stops? A = zeros(1, 525600); % Pre-allocation, faster and simple...

5 years ago | 0

| accepted

Load more