Answered
Why does this code give error?
Use angle() instead of arg() to get the argument of complex numbers.

5 years ago | 0

| accepted

Answered
How to find the ranges for color in HSV method?
The ranges correspond to data that's scaled [0 255], not [0 1]. hsv = rgb2hsv(double(thisFrame)); Note that he's using doubl...

5 years ago | 0

| accepted

Answered
Separating overlapping edges in an image to get an accurate count
This works, but I had trouble trying to get watershed() to work without a little tweaking. inpict = im2double(imread('cells.jpg...

5 years ago | 0

Answered
When I set the voltage = 2.5, the volume isn't being calculated and displayed on the command window and the wrong value for US Gallons is being calculated. Everything else is working apart from this
This should fix the one error: if voltage == 2.5 % voltage, not volume volume = (pi*((D)^2)*C)/2; fprintf('Volume = ...

5 years ago | 0

Answered
how I can get peak and mean
You mean something like this? mean(myarray(:)) max(myarray(:))

5 years ago | 0

Answered
How to convolve two matrices with different sizes?
There's no reason to be looping over the kernel like that. Let's say you wanted to replicate the behavior of conv2: inpict = i...

5 years ago | 0

Answered
cheching exist Variable on the IF statment
Something like this if ~exist('myvariable','var') % set default value or error or whatever end Although using exist() du...

5 years ago | 0

Answered
Generate sequence of sine waves with changing amplitude
f = 2.36e3; w = 2*pi*f; %sampling frequency fs = 50000; dt = 1/fs; %Amplitude of pickup signal at each of 11 data points,...

5 years ago | 1

Answered
Optimization of nested "for" loops
Should be able to do something like this without the loop (don't need to preallocate either): x = X'-X; y = Y'-Y; PHI = ...

5 years ago | 0

| accepted

Answered
How to insert a unique legend with subplot?
This is kind of roundabout, but maybe it helps: subplot(1,3,1) plot(x,y1,'*-r', 'LineWidth', 1) hold on plot(x, y2, '*-k', '...

5 years ago | 0

| accepted

Answered
How can i reshape the code as below
Try this: k = '0924668B8FB8700000000000D96089C6C815880000000000EF1A2E75CDB28000' wo = reshape(k(1:2:end),4,[]); we = reshap...

5 years ago | 1

| accepted

Answered
Unrecognized function or variable 'MBBR_Fun5'.
This error is pretty misleading, but there are clues. The error makes it sound like it can't find the function file -- but noti...

5 years ago | 0

Answered
How to plot 3D surface using excel data
You can just use griddata() A = [7.41162174 6.61953159 270.85708135; 270.85708135 4.14570206 150.27856724; 3.49277506 4.128...

5 years ago | 0

| accepted

Answered
How can I assign a point from a matrix to a group in another matrix
The short answer is that you can't. If it's elementwise, I don't see that there is enough uniqueness between sets to determine ...

5 years ago | 0

| accepted

Answered
How can I find valid values of v2 for which all currents are lower than 1mA
Okay. I'll bite. We can see how many mistakes I make -- but first we need to clarify the problem description: % Network Eqns ...

5 years ago | 0

Answered
how can I exclude NaN when I calculate average?
If you're using a reasonably new version: A = [1 3 5 NaN 9] B = mean(A(:),'omitnan') If you need it to work in older versions...

5 years ago | 0

| accepted

Answered
Align multiple columns by their center index value
Something like this: A = [1 1 1; 2 2 2; 3 3 3; NaN 4 4; NaN 5 5; NaN NaN 6; NaN NaN 7; NaN N...

5 years ago | 1

| accepted

Answered
How to delete multiple elements from array in step by step process and how to store remaining elements in array
For storing dissimilar size/type objects, you can use a cell array: A = [1 0.2 7 0.5 3 8]; B = cell(numel(A),1); B{1} = A; ...

5 years ago | 1

| accepted

Answered
Index exceeds the number of array elements (4)---how can I solve this issue
This at least lets it produce an answer. I don't know that it's the right answer, but it's an answer. X=X0; Xold=X0; for i=1...

5 years ago | 0

| accepted

Answered
How do I mark a specific point on a graph?
You could do this using text() and a bunch of other wrangling, or you could just use datatip(): x = linspace(0,1,100); f = x.^...

5 years ago | 1

Answered
Eliminate noise in the form of vertical lines in the image
A median filter might work inpict = im2double(rgb2gray(imread('linenoise.jpg'))); outpict = medfilt2(inpict,[1 5]); outpict =...

5 years ago | 0

| accepted

Answered
How to swap specific elements position of a matrix
The problem is a bit underdefined. I'm going to make the following assumptions: There are always exactly two nonzero elements ...

5 years ago | 0

| accepted

Answered
Smooth 2D surface of surface plot
If the goal is to improve the smoothness of the volume of rotation, then we should go back to that. There are a few things we c...

5 years ago | 0

| accepted

Answered
Surface Plot with x and y as an Matrix and z as a array?
You can do a surf plot with three matrices of equal size If your x and y arrays are simple and invariant along one dimension, t...

5 years ago | 1

Answered
What exactly does %+09.3f mean?
https://www.mathworks.com/help/matlab/ref/sprintf.html %+09.3f (+) -- flag means always display sign before number 0 -- add l...

5 years ago | 0

| accepted

Answered
"Unable to do ' _ ' because of index mismatch"
I don't even know what's supposed to be going on here % mod is 1x16 % i_mat is 3x100 for j = 1: length(mod) % 1:16 for i...

5 years ago | 0

| accepted

Answered
Index in position 2 exceeds array bounds (must not exceed 1001)
U is 8x1001. i spans [1 8] j spans [2 1000] but you index ahead of j by 2. U(i,j+2) You'd either have to stop at 999 (i.e...

5 years ago | 0

| accepted

Answered
Index exceeds the number of array elements (3).
The problem is caused because D=['т','п','к']; S=['жаркое','теплое','холодное']; is horizontal concatenation of character ar...

5 years ago | 0

Answered
how to add uniform noise to image
There are some problems: im=imresize(im,[256 256]); % there's no need; it's already 256x256 b=255; % why is the noise variance...

5 years ago | 2

| accepted

Answered
How to observe this portion of the graph
There are view control tools in the figure toolbar/menu. In newer versions, there's also contextual axes toolbars. You...

5 years ago | 0

| accepted

Load more