Answered
Assigning multiple outputs from a function to the multiple variables and repeat the same for several inputs to the function
Please read Matlab's Onramp to learn the basics. It is not efficient to repeat the tutorials in the forum. params.N = 2; for i...

3 years ago | 0

Answered
A really, really strange situation (the same two copies of code on the same computer with the same version of matlab running at very different times)
You have two codes. As far as I can see, you are posting one of them. You mention, that comments and spaces can be different. Th...

3 years ago | 1

| accepted

Answered
How to convert all path images folder to one .mat file
Folder = 'C:\Users\hp\Desktop\testing\abood'; FileList = dir(fullfile(Folder, '*.jpg')); Data = cell(1, numel(FileList))...

3 years ago | 0

| accepted

Answered
Faded eps figure in LaTex
Is one a vector graphic and the other one rasterized? This can happen, if the RendererMode of the figure is set to 'auto'. Defin...

3 years ago | 1

| accepted

Answered
Strange result in subtraction operation
format long g a = 4.238257316854621; b = 4.238257316854609; wanted = 1.12e-14; got = a - b drift = max(eps(a), eps(b))...

3 years ago | 0

Answered
performance: fullfile function execution efficiency could be improved.
Seriously? fullfile inserts file separators on demand, while your code is a simple concatenation of strings. In addition fullfi...

3 years ago | 0

Answered
how i can convert a matrix in to a column vector and again i need to convert that column vector in to matrix form without disturbing the original pixels position
RGB = rand(640, 480, 3); R = RGB(:, :, 1); G = RGB(:, :, 2); B = RGB(:, :, 3); Rv = R(:); % Vectors for e...

3 years ago | 0

Answered
Read run-length encoding data from a table
This is one of the files I would not import with readtable, but manually: [fid, msg] = fopen(FileName, 'r'); assert(fid > 0, '...

3 years ago | 0

Answered
ode45 and rungekutta yield different result
The function to be integrated contains: if abs(vrel)/v_band<0.001 ... if abs(faply)<uS*Fn This looks like th...

3 years ago | 1

Answered
how to deal with an error with exportgraphics
As the documentation says, the handle must be: axes | figure | standalone visualization | tiled chart layout | ... plot replie...

3 years ago | 0

Answered
How to define if a point is inside or outside a 3D pyramidal area?
If you have the 4 points of the pyramid given as 1x3 vectors, A,B,C,D,F (by the way, where is E?): % [UNDER CONSTRUCTION! RESUL...

3 years ago | 1

Answered
Help with unstack function on matlab
According to the documentation of unstack the 3rd input must be a scalar, CHAR vector or string. You provide the vector 1:53 ins...

3 years ago | 0

Answered
I want to draw graph between "P" and "x" but it is throwing the following error.
Try: fplot(P, [1 6]) % not P(x)

3 years ago | 1

Answered
error in processing multiple images in a loop code
I assume this was meant: [~, filename, ~] = fileparts(filenames); % ^^^^^ instead of fileinfo

3 years ago | 0

Answered
Adding a Vector at Certain Points of a Sequence
seq = [1 0 1 0 0 1 1 0 0 1]; signal = [0 0 0 1 2 1 0 0 0 0]; seq = randi([0,1], 1, 1e5); signal = randi([0, 10], 1, 1e2)...

3 years ago | 0

Answered
How to understand and apply arrayfun - getting intuition beyond the documentation.
You can replace arrayfun by a loop: X = [1, 12; 1, 13; 1, 12; 2, 4; 2, 4; 2, 4; 3, 9; 3, 9; 3, 9]; L = X(:,1); M = arrayfun...

3 years ago | 3

Answered
Save plots in a for cycle
If you want to create every 2nd image only, simply use: for i = 1:2:sz(3) % ^^ then i is [1, 3, 5, ...] To save the ...

3 years ago | 0

| accepted

Answered
reduce values on a vector
You are overwriting the variable Surveillance_signal_samples repeatedly: for kk =1:nSurv Surveillance_signal_samples=Surve...

3 years ago | 0

| accepted

Answered
How to output a new matrix that swaps the position of the beginning and end of a separate matrix
latitude = zeros(1,18); longitude = zeros(1,43); for i=1:18 latitude(i) = 48+(i-1)*1; end for j=1:43 longitude(j)...

3 years ago | 1

| accepted

Answered
Newton to see when the Gradient = 0
In the line: xd=x+d; x is a [2x1] vector and d a [1x2] vector. The implicite expanding replies a [2 x 2] matrix. Maybe this f...

3 years ago | 0

Answered
How to apply an IIR-Filter correctly on a PCM-Signal?
Yes, this filter reduces the power massively: data = load('handel.mat'); signal = data.y; b = [0.049922035 -0.09...

3 years ago | 0

| accepted

Answered
Dimensions of arrays being concatenated are not consistent.
The message means, that you cannot concatente arrays horizontally, if they have a different number of rows. Or vertically, if th...

3 years ago | 0

Answered
Create cell array of handle functions, which have been created from 2x1 double arrays
a = [1; 2]; b = [3; 4]; f = cell(2, 1); for ff = 1:2 f{ff} = str2func(sprintf('@(t) %d * t + %d', a(ff), b(ff))); end f

3 years ago | 0

| accepted

Answered
changing the legend line style (":","-","--","-.") for 4 black lines in plot instead of using multip colour
figure; axes('NextPlot', 'add', ... 'LineStyleOrder', cellstr([":", "-", "--", "-."]), ... 'ColorOrder', zeros(1, 3))...

3 years ago | 0

Answered
Finding Sequences of 1's values
Some timings of the methods provided in this thread: x = randi([0, 1], 1, 80000); format long g disp(timeit(@() Jos(x))) d...

3 years ago | 0

Answered
unix/system comand Always print out some environment setting when using it
% Without semicolon: system('pwd') % With semicolon: system('pwd'); % With semicolon and catching outputs: [status, out] = ...

3 years ago | 0

Answered
Is there a reason why row vectors are default in Matlab?
Matlab was developped as "Matrix Laboratory". So the default type is a double matrix. If the focus has been set to vectors, it w...

3 years ago | 0

Answered
Translate file name in mapped drive to unc path filename
No, there is no Matlab command to perform this automatically. net use sovles this and WMIC can help also: [status, out] = syst...

3 years ago | 0

Answered
How to efficiently allocate memory using a parfor loop
ET = permute(E_mat, [2,3,1]); Q = zeros(size(ET)); parfor n = 1:size(E_mat, 3) Q(:,:,n) = sigmaE(n) / 2 / mass_density(n...

3 years ago | 1

| accepted

Answered
exportgraphics does not save at specific location
The folder is existing but Matlab cannot create a file in it. Then Matlab does not have write permissions in this folder. filea...

3 years ago | 0

Load more