Answered
How to replace array elements in specified indexes with another array?
It can be done, something like this: https://www.mathworks.com/matlabcentral/answers/829183-how-to-remove-outlier-of-time-serie...

5 years ago | 0

| accepted

Answered
What operations/functions can I use to speed up these nested for loops?
Try this: A = im2double(rgb2gray(imread('eyetest.png'))); avg = 10; sig = 20; % create gaussian filter r = sig*5; xx =...

5 years ago | 0

| accepted

Answered
How do I reduce the number of points in a plotted trace?
I don't know of any simple means to convert an image into a minimal line drawing. Features like the intersection of the facial ...

5 years ago | 1

| accepted

Answered
Why do I get this error while plotting this?
errorbar() doesn't support datetime inputs. You'll end up needing to avoid that, which might complicate things a bit: https://...

5 years ago | 0

Answered
Stretch a plot while keeping area under same
If you scale the curve in the X direction by a factor of 2, then scale the curve in Y by a factor of 1/2. X = 0:100; % linear...

5 years ago | 0

Answered
TIFF different than BMP in image compression
I'm assuming you're asking about picking a format when writing an image file. The answer depends, but generally, TIFF would be ...

5 years ago | 0

Answered
How to split matrix into arrays without loop.
You should be able to just do: PL2 = permute(reshape(PL.',3,[],8),[2 1 3]); to get the same result. Bear in mind that this as...

5 years ago | 0

| accepted

Answered
How can I generate a vector that corresponds to counted occurence data?
Maybe something like this will work: A = [5 3 1]; n = [2 4 6]; B = repelem(A,n)

5 years ago | 0

| accepted

Answered
Centroids distance in pixel
Eh. This is a kludgy extension of the example I linked to. I just used a modified copy of your screenshot: inpict = logical(2...

5 years ago | 1

| accepted

Answered
How to set plot color for N curves to be a gradient of N color shades between light blue and dark blue (or any other color)?
Yeah. That's not valid indexing. You could use interpolation tools to make the CT generator a function of the table size and t...

5 years ago | 3

Answered
Finding contour level for given x,y coordinate
Well, you already have the velocity data, so this shouldn't depend on the plot at all. You can interpolate something like thi...

5 years ago | 0

| accepted

Answered
How can I find the centroids of closely seperated object?
I'm going to go out on a limb here and guess that the image you're feeding to regionprops() is a numeric image instead of a logi...

5 years ago | 0

| accepted

Answered
How to retain the updated variable value after each iteration in a loop.
After the loop exits, the variable i is just a scalar 365. Plotting s against a scalar just gives you a single dot. Since what...

5 years ago | 0

| accepted

Answered
How do I fuse together 4 images (of the same dimensions) together in a checkerboard-like fashion?
Consider the example: % generate test images % this part uses MIMT from FEX, but it's otherwise not needed inpict = imread('c...

5 years ago | 0

| accepted

Answered
What is best way to reduce speckle size?
Since it's unclear what properties are important, I'll just make something up. This does the "shrinking" by essentially cropp...

5 years ago | 1

Answered
Hangman, outputting unknowns while maintaining correct guesses in a string vector
If you ask me, this is easier done with character vectors instead of strings. wordarray = {'potato','tomato','apple','orange'...

5 years ago | 1

Answered
Superposing multiple 3d plots
You should be able to get the 3D view back by just specifying it explicitly after the plotting is done. view(3)

5 years ago | 0

| accepted

Answered
HOW TO RESHAPE 3D ARRAY WITH DIFFERENT DIRECTIONS?
This is why using numbered variables instead of arrays is a bad idea. No need for a loop. Depending on the size of the input...

5 years ago | 0

| accepted

Answered
Permanent TIP on a PLOT:
Store the handles, pass the handles to legend() and specify the names in a cell array. h = plot(x,y); for k = 1:K % ......

5 years ago | 1

| accepted

Answered
how to remove horizontal and vertical lines from image?
I'll throw in my own. This uses hough() and houghpeaks() to rectify the image so that rectangular filters will align with the b...

5 years ago | 1

Answered
I want to draw the graph 100 times without changing the inputs and also draw the average of the graphs If anyone can complete the code Thanks
This could definitely be simplified %Parameter and initional valuse gama=0.5; beta=1; N=100; i0=5; dt=0.01; tend=30 ; nump...

5 years ago | 0

| accepted

Answered
How to get an array like this : a= [1 1 1 1 to 1 2 3 4] using for loop or any other way ? Please help.
EDIT: okay, that's different than what I thought I read. I don't know how generalized this needs to be, but at least this produ...

5 years ago | 1

| accepted

Answered
count pixels within a specified range
If I'm understanding the problem right: m = false(s); m(sub2ind(s,C(:,2),C(:,1))) = 1; m = bwdist(m)<=r; %m(:,[1:corners(1,1...

5 years ago | 0

| accepted

Answered
Allow tab autocomplete without initial letter
If you're talking about enabling tab-completion for your own code, that's done with a functionSignatures.json file. https://www...

5 years ago | 0

Answered
How to calculate the surface area of an object in an image?
This will calculate both the sectional area and the surface area in pixel-equivalent units. You'll have to scale them according...

5 years ago | 0

| accepted

Answered
Find a column of Z direction in 3D model
Idk if this is more what you're after: A = importdata('magnetite_DATA_1.txt'); symbole = A.textdata(:,1); x0 = A.data(:,1); ...

5 years ago | 0

| accepted

Answered
How can I convert the following loop operation into vectorization?
I'm not sure why you're using norm() on scalars. Abs() has the same effect. % test array/size N = 4; % rows/cols D = 4; % pa...

5 years ago | 0

Answered
How to find maximum vertical distance between reference line and a curve?
Something like this: % sample vectors don't share the same x-positions or length % assuming both x vectors are monotonic incre...

5 years ago | 3

| accepted

Answered
Not sure how to use figure('Position',[ ]) to get figures with proper dimensions
The margins needed for the labels/title etc may vary, so the inner position will vary. If you can come up with an inner positio...

5 years ago | 0

| accepted

Answered
Extract number after specific words
Something like this? C = {'latitude 45,0000','longitude 2,0000'; 'latitude 47,5000','longitude 5,0000'; 'latitude 50,8000',...

5 years ago | 0

| accepted

Load more