Respondida
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...

casi 5 años hace | 0

| aceptada

Respondida
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 =...

casi 5 años hace | 0

| aceptada

Respondida
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 ...

casi 5 años hace | 1

| aceptada

Respondida
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://...

casi 5 años hace | 0

Respondida
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...

casi 5 años hace | 0

Respondida
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 ...

casi 5 años hace | 0

Respondida
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...

casi 5 años hace | 0

| aceptada

Respondida
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)

casi 5 años hace | 0

| aceptada

Respondida
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...

casi 5 años hace | 1

| aceptada

Respondida
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...

casi 5 años hace | 3

Respondida
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...

casi 5 años hace | 0

| aceptada

Respondida
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...

casi 5 años hace | 0

| aceptada

Respondida
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...

casi 5 años hace | 0

| aceptada

Respondida
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...

casi 5 años hace | 0

| aceptada

Respondida
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...

casi 5 años hace | 1

Respondida
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'...

casi 5 años hace | 1

Respondida
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)

casi 5 años hace | 0

| aceptada

Respondida
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...

casi 5 años hace | 0

| aceptada

Respondida
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 % ......

casi 5 años hace | 1

| aceptada

Respondida
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...

casi 5 años hace | 1

Respondida
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...

casi 5 años hace | 0

| aceptada

Respondida
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...

casi 5 años hace | 1

| aceptada

Respondida
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...

casi 5 años hace | 0

| aceptada

Respondida
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...

casi 5 años hace | 0

Respondida
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...

casi 5 años hace | 0

| aceptada

Respondida
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); ...

casi 5 años hace | 0

| aceptada

Respondida
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...

casi 5 años hace | 0

Respondida
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...

casi 5 años hace | 3

| aceptada

Respondida
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...

casi 5 años hace | 0

| aceptada

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

casi 5 años hace | 0

| aceptada

Cargar más