How can i call the first point that appears in a matrix with a certain value?
"I tried this way however once there is more than one 6 in the matrix firstappearence value would be incorrect." So, if you wan...

15 Tage ago | 0

I need to contour a round object in a image.
Once you've gotten the largest blob, if you want to outline the region in red over the original image (in the overlay), you can ...

15 Tage ago | 1

get segmentation size image
Try getting the bounding box of the convex hull. mask = bwconvhull(mask, 'union'); props = regionprops(mask, 'BoundingBox'); ...

15 Tage ago | 0

Create polynomials in MATLAB
Did you try to just type it out, like dv = 3; x = [1, 2] % Whatever.... lamdaVector = [0.6, 0.4]; lambda = 0; for k = 1 : d...

16 Tage ago | 0

detecting elements change in an array
Try this: x=zeros(1,36); % Get 20 random indexes to turn to 1's. indexes = sort(randperm(length(x), 20)); % Initialize by tu...

16 Tage ago | 0

How to save a matix as an image?
Save it as a .mat file instead of an image format file save('my floating point image.mat', 'myImage'); % Save myImage into a .m...

16 Tage ago | 1

how can i change the dimension of the matrix?
Try this: g2 = [g(:,:,1); g(:,:,2); g(:,:,3)]; The result is 153 rows by 500 columns. Here's a full demo with a 3-D RGB true ...

16 Tage ago | 0

Intersection of two colored images and display output also as colored image where common regions are only highlighted
diffImage = imabsdiff(img1, img2); show(diffImage); Common pixel values will subtract to zero and be black. Any non-black pix...

16 Tage ago | 0

| accepted

how do you plot graph sine
Try this. It should be pretty self-explanatory. Note in the first plot that, since it's not using enough points (sampling belo...

16 Tage ago | 1

| accepted

I was wondering how to convert a file created using ascill to an integer.
Try writematrix writematrix(data, 'my data.txt');

16 Tage ago | 1

| accepted

im finding error in line 18
Perhaps instead of that loop assigning 298 to everything you simply want % Get a list of all the j and k we want to iterate ove...

16 Tage ago | 0

How can I color all objects as the same in an image where several objects have been extracted in the form of a label matrix?
You don't need bwlabel(), label2rgb(), or colormaps. You can simply use imoverlay: grayImage = imread('rice.png'); % A gray sc...

16 Tage ago | 0

| accepted

how to remove outliers in large data sets?
Try this: data = readmatrix('Copy of data.xlsx'); x = data(:, 1); y = data(:, 2); % Plot just the first cycle. last = round...

16 Tage ago | 1

| accepted

Try this: % Get file name fullFileName = fullfile(pwd, 'a.txt') if ~isfile(fullFileName) errorMessage = sprintf('Error: ...

16 Tage ago | 0

| accepted

i need help with an older version of matlab, i don't understand the error message
metrique2 is a matrix with rows and columns, let's call them R and C. metrique2(i, :) or metrique2(j, :) is the i'th or j'th ro...

16 Tage ago | 0

Does Matlab have the function to format script?
Type control-a, to select all text in your editor window, then control-i, to fix (properly align) the indenting of your lines ...

16 Tage ago | 1

Find local maximum from jpg
I see about 3 different regions. I'm not sure what is sand or water or something else. If you use drawfreehand to manually tra...

16 Tage ago | 0

How to implement kriging in Matlab?
I believe I saw somewhere in the documentation that scatteredInterpolant did kriging. Attached is a demo.

16 Tage ago | 0

What to do when teacher asks you to pirate matlab
So open software is great?!?! One word "log4j". Enough said? Here's some more open software vulerabilities: https://www.wh...

16 Tage ago | 1

How to adjust 'measured distance' on a binary image
You can sum the white pixels horizontally and then threshold it at some percentage of the max width verticalProfile = sum(mask,...

17 Tage ago | 1

| accepted

How to compare two non-integer value together?
Do you mean, if they're vectors: logicalIndexes = x2 > (0.80 * x1); % or linearIndexes = find(logicalIndexes); Or if they're ...

17 Tage ago | 0

Making a simple flower
See my ellipse demos and adapt as needed.

18 Tage ago | 0

Hi. Anyone has an idea how to find the area at red region area?
% Take the 3 largest blobs mask = bwareafilt(mask, 3); % Assume we want the middle one. Label the blobs 1, 2, and 3. [label...

18 Tage ago | 0

| accepted

is there a better way of accessing the csv files from each folders in the path below?
How about getting all the filenames and looping over them. topLevelFolder = 'F:\3-PIV_Experimental_Data\Outlet_110\'; filePatt...

18 Tage ago | 0

how to find location on a blob
How about [rows, columns] = find(binaryImage); [rightMostColumn, index1] = max(columns) [bottomMostRow, index2] = max(rows) ...

18 Tage ago | 0

| accepted

Error found: Index in position 1 is invalid. Array indices must be positive integers or logical values. Error in MyCost (line 25) z=z+w(i,j)*d(p(i),p(j)); Error
See the FAQ for a thorough explanation. https://matlab.fandom.com/wiki/FAQ#.22Subscript_indices_must_either_be_real_positive_in...

18 Tage ago | 0

IF statement not executing
You need to check the index of the drop down list, or else get the selected string and compare the that string (only) to "Plot" ...

18 Tage ago | 0

| accepted

Really interesting question.Does it have a solution?
If you're looking for a MATLAB function, try linspace().

19 Tage ago | 0