Answered
sinc(x) and sin(pi*x)/(pi*x) produces the same graph BUT different fft?
|y2| contains a NaN at x==0, but |y| does not. it seems that I cant fft the y2 Please be more specific. Do you get an err...

8 years ago | 0

Answered
How to put an axes into the foreground layer in GUI (made by GUIDE)?
What about <https://www.mathworks.com/matlabcentral/fileexchange/23680-axshift FEX: axisshift>? This would avoid the limitations...

8 years ago | 0

Answered
Number of elements must be the same?
Sf = NaN(1,length(t)); for j = 1:length(t) index = find(abs(V(:,j)-K+S)< eps_star, 1, 'last'); if ~isempty(index)...

8 years ago | 0

Answered
why do i get this error in line 15? "Subscript indices must either be real positive integers or logicals."
Your x(1) is |1.96|. Then in the first iteration, where |e=1|, |fj{x(e)}| tries to use 1.96 as index of the cell array |fj|. But...

8 years ago | 0

| accepted

Answered
Unable to perform assignment because the size of the left side is 122-by-123 and the size of the right side is 146-by-158.
The variable |filtered_img| is existing before. Either use clear filtered_img before assigning a new value. Or better st...

8 years ago | 0

| accepted

Answered
Why is MatLab crashing and not displaying plots?
All details you can provide is that the problem occurred "suddenly" and that there is a "resolution problem". This is very few i...

8 years ago | 0

Answered
Removing all full 0 images in an 4d matrix
LinImage = reshape(images, [], 300); notBlack = any(LinImage, 1); Cleaned = images(:, :, :, notBlack); It is less st...

8 years ago | 2

Answered
i want to get vectors of same length in my result.
This line is a problem: N = size(BC,99); This replies the length of 99th dimension of the array BC. I'm sure, that you d...

8 years ago | 0

Answered
How can people who are bad at math and have no programming aptitude learn MATLAB? (Long question)
This is a Matlab forum and we discuss problems concerning Matlab. The problem you describe concerns a Matlab user, or better a p...

8 years ago | 3

Answered
Whenever I import data from excel, one of the column that contains values such as 2.1ELKFJQLHxxxMxxxxxSx4xxxIxSxJJxxxxx, ends up with NaN in Matlab table.
You forgot to post your code. I guess it is: [num, txt, raw] = xlsread(FileName); Now you observe, that the file of |num...

8 years ago | 0

| accepted

Answered
replace 0 with NaN for specific column in a matrix within cell
% Some test data: data = cell(1, 12); for k = 1:12 data{k} = randi([0,2], 600, 4); end % Replace 0 by NaN i...

8 years ago | 0

| accepted

Answered
MATLAB coder - can't get the 'coderand' .exe to work correctly
To get a documentation about |rand|, see <https://www.mathworks.com/help/matlab/ref/rand.html doc rand>. At the bottom there is ...

8 years ago | 0

| accepted

Answered
Problem reading lines from .dat file
Using commas as decimal point and separator of the data is not only "inconvenient", but a disaster. The trustworthy solution is ...

8 years ago | 0

| accepted

Answered
How to convert a color of image to green?
The error message means, that the imported image is a grey scale image, such that I is a 2D matrix, not a 3D RGB array. If it is...

8 years ago | 0

Answered
Saving Peaks into cell arrays(s)
Maybe you want this: T = num2cell(extract(textract > thresh)); Or if you really want a loop: lgth = length(extract)...

8 years ago | 0

Answered
how to solve an error ?
If you post the *complete* error message, the readers can know, which line is failing. I guess it is: rawdata(:,2) = str2nu...

8 years ago | 1

Answered
How to plot overlapping lines while esnuring both remain visible?
% The actual data: t = 0:5; x1 = zeros(size(t)); x2 = zeros(size(t)); tt = linspace(0, 5, 20); x1t = interp...

8 years ago | 2

Answered
How to plot X,Y,Z coordinate from UITable on GUI
I guess boldly: A = cell2mat(nodaldata); % assignin('base','t1',A); % Is this needed? X = nodaldata(:, 1); Y = no...

8 years ago | 0

Answered
Strange results for evaluating quadratic function on a linspace
Welcome to the world of numerics with limited precision. Remember that floating point numbers are displayed in decimal format, b...

8 years ago | 0

Answered
I have trouble installing matlab 2007b in Linux
As far as I know, the license file for an older Matlab version is exactly the same one, which you get for the current version. ...

8 years ago | 0

Answered
How do I prevent the legend from REALLY auto-updating
Creating the axes object and lines only to hide them later sounds indirect and cluttered. What about setting the 'Position' of t...

8 years ago | 0

Answered
Automatically close parenthesis when we open it
The auto-completion works sufficiently in NotePad++: Enable it in Settings -> Preferences -> Auto Completion -> Select the wante...

8 years ago | 0

Answered
Two surfaces plot hard to distinguish
The surface plots are color according to their height in Z-direction. It is not meaningful to use a colored patch in the legend ...

8 years ago | 0

| accepted

Answered
How to plot my grafik in a gui axes ?
Do not use |gca| to obtain the handle of an axes, but specify the handles of an existing axes object: plot(value(:,2),valu...

8 years ago | 0

Answered
Taylor's Approximation playing up
The result is mathematically correct, but the display could be simplified. 1301357606610903 / 4722366482869645213696 equals 1 / ...

8 years ago | 0

| accepted

Answered
how to write code to add some scalar value to each 4by4 cell of a dataset?
If these are your inputs (see my comment): C = cell(4, 4); for iC = 1:4 C{iC} = rand(64, 64); end toAdd = [10...

8 years ago | 1

Answered
iterations / trial and error method to find a variable.
You can use |fzero| to solve this 3rd order polynomial.

8 years ago | 1

| accepted

Answered
Defining a projection function
function a = test2(C) A = 1; B = 10; a = A .* power(B, 0.3) .* power(C, 0.7); end Or easier: function a = ...

8 years ago | 0

Answered
Error when want to display image in another axes in GUI
Without seeing the code it is hard to suggest, how to fix it. So just a bold guess: No appropriate method, property, or fiel...

8 years ago | 0

Answered
How to graph a piecewise function NOT using if-else statements
Start by using |meshgrid| and |surf| with a non-piecewise function: find out how to draw a plane at all. Then use this method...

8 years ago | 1

Load more