Answered

Finding Minimum Distance Between Points to Find Indexed Variable

If you don't have the statistics and machine learning toolbox you can do the following: [~,idx] = min(abs(dtamatrix(:,2) - Feli...

Finding Minimum Distance Between Points to Find Indexed Variable

If you don't have the statistics and machine learning toolbox you can do the following: [~,idx] = min(abs(dtamatrix(:,2) - Feli...

24 jours ago | 0

| accepted

Answered

Create multiple arrays with different names and specific data

It is possible to do exactly what you asked but that is considered a bad coding practice (explanation here). Why don't you st...

Create multiple arrays with different names and specific data

It is possible to do exactly what you asked but that is considered a bad coding practice (explanation here). Why don't you st...

25 jours ago | 0

| accepted

Answered

Creation of an automatic polyline

It looks like you have a binary image but you uploaded it as a .jpeg, I have included 3 lines to "workaround" and get back to an...

Creation of an automatic polyline

It looks like you have a binary image but you uploaded it as a .jpeg, I have included 3 lines to "workaround" and get back to an...

25 jours ago | 0

| accepted

Answered

How to crop a circle from an image?

Try the following tutorial: % Setup clear close all clc inputImg = imread('cameraman.tif'); % Show demo Image hf = figu...

How to crop a circle from an image?

Try the following tutorial: % Setup clear close all clc inputImg = imread('cameraman.tif'); % Show demo Image hf = figu...

25 jours ago | 0

| accepted

Answered

calculating area and perimeter for pap-smear image

There are numerous ways you could segment the nucleus, I elected here to threshold based on R,G,B values in the image. To work o...

calculating area and perimeter for pap-smear image

There are numerous ways you could segment the nucleus, I elected here to threshold based on R,G,B values in the image. To work o...

26 jours ago | 0

| accepted

Answered

I want to extract values from second column of the matrix which correspond to the range 6 to 7 of the first column. How to do it?

Let's say your matrix is called M, then you can extract rows from column 2 corresponding to those in column 1 which are between ...

I want to extract values from second column of the matrix which correspond to the range 6 to 7 of the first column. How to do it?

Let's say your matrix is called M, then you can extract rows from column 2 corresponding to those in column 1 which are between ...

29 jours ago | 0

| accepted

Answered

3-D matrix operations

Here's the method I was suggesting. The idea is to take the first value and add half the difference (effectively interpolating) ...

3-D matrix operations

Here's the method I was suggesting. The idea is to take the first value and add half the difference (effectively interpolating) ...

environ un mois ago | 0

Answered

Read text file with string

You could use the readmatrix function as follows: filename = 'My2.TXK' opts = detectImportOptions(filename,'FileType','text') ...

Read text file with string

You could use the readmatrix function as follows: filename = 'My2.TXK' opts = detectImportOptions(filename,'FileType','text') ...

environ un mois ago | 0

| accepted

Answered

Extract data (timestamps) from csv file

You could read the file in as a character vector with fileread and then use regexp as follows: filetext = fileread('Info.csv');...

Extract data (timestamps) from csv file

You could read the file in as a character vector with fileread and then use regexp as follows: filetext = fileread('Info.csv');...

environ un mois ago | 0

| accepted

Answered

How to Interpolated data outliers

Generate some sample data: C = (1:3630).'; idxout = randperm(3630,500); % random index for outliers C(idxout) = C(idxout)+200...

How to Interpolated data outliers

Generate some sample data: C = (1:3630).'; idxout = randperm(3630,500); % random index for outliers C(idxout) = C(idxout)+200...

environ un mois ago | 1

| accepted

Answered

matlab code How to dived 400*500 image into 40*50 and calculate object area in each block. put all blocks in one imafe

You can find out which blocks are crops (according to your definitions) as follows: B = blockproc(Img, [40 50], @(block_struct)...

matlab code How to dived 400*500 image into 40*50 and calculate object area in each block. put all blocks in one imafe

You can find out which blocks are crops (according to your definitions) as follows: B = blockproc(Img, [40 50], @(block_struct)...

environ un mois ago | 0

Answered

By using computervision toolbox I'm trying to play a video in MATLAB using this code, but only one frame is displayed on the window

You could do the following: a = vision.VideoFileReader('spur gear.avi' , 'VideoOutputDataType', 'double'); VideoPlayer = visio...

By using computervision toolbox I'm trying to play a video in MATLAB using this code, but only one frame is displayed on the window

You could do the following: a = vision.VideoFileReader('spur gear.avi' , 'VideoOutputDataType', 'double'); VideoPlayer = visio...

environ un mois ago | 0

Answered

How can I compare distance (not only between two points, but also a set of points)

As I understand it, you have 10 by 100 points represented in variables X and Y which are both 10 by 100 matrices. A given point ...

How can I compare distance (not only between two points, but also a set of points)

As I understand it, you have 10 by 100 points represented in variables X and Y which are both 10 by 100 matrices. A given point ...

environ un mois ago | 0

| accepted

Answered

Simulation Domain (Region)?

I would say what you want is the meshgrid function. Have a look at the <https://uk.mathworks.com/help/matlab/ref/meshgrid.html d...

Simulation Domain (Region)?

I would say what you want is the meshgrid function. Have a look at the <https://uk.mathworks.com/help/matlab/ref/meshgrid.html d...

environ un mois ago | 0

Question

Is there a property to modify the marker size of a drawline graphics object?

I'm using the drawline function and wondering if it would be possible to modify the marker sizes? If for example we have the fol...

environ un mois ago | 1 answer | 0

Answered

How to reshape a single column matrix in the following example?

If you write the following you can directly modify the CT_matrix, no need to separate it out into a column vector: ind_lte_20 =...

How to reshape a single column matrix in the following example?

If you write the following you can directly modify the CT_matrix, no need to separate it out into a column vector: ind_lte_20 =...

environ un mois ago | 0

| accepted

Answered

Take the sum of an array until a limit is reached determined by a vector of the same length

For a single result you could write the following to get the sum for an arbitrary track length of 10 mm, and you have the option...

Take the sum of an array until a limit is reached determined by a vector of the same length

For a single result you could write the following to get the sum for an arbitrary track length of 10 mm, and you have the option...

environ un mois ago | 1

| accepted

Answered

Numbering options in a table

You could change Line 58 to the following: disp(crossSectionInfo.Resistance(str2double(result)))

Numbering options in a table

You could change Line 58 to the following: disp(crossSectionInfo.Resistance(str2double(result)))

environ un mois ago | 0

Answered

I don't get the correct output from my function

The function is correct. However, because this function outputs very large numbers depending on your range (in terms of absolut...

I don't get the correct output from my function

The function is correct. However, because this function outputs very large numbers depending on your range (in terms of absolut...

environ 2 mois ago | 0

| accepted

Question

How could I make a callback that updates when the user moves an roi?

I'm making an app which loads and displays the same image side by side in app.UIAxes and app.UIAxes2. I have a rectangle roi obj...

environ 2 mois ago | 0 answers | 0

Answered

To determine the number of distinct pairs of value(s) in each column of matrix.

You could do the following. First find rows where there is only one other element equal to the element in the first column idx ...

To determine the number of distinct pairs of value(s) in each column of matrix.

You could do the following. First find rows where there is only one other element equal to the element in the first column idx ...

environ 2 mois ago | 0

| accepted

Answered

How to print contents of nested cell array to uitable?

I think the best thing to do is make another cell array, B, as follows: nRows = max(cellfun(@numel,A)) nCols = numel(A) B = c...

How to print contents of nested cell array to uitable?

I think the best thing to do is make another cell array, B, as follows: nRows = max(cellfun(@numel,A)) nCols = numel(A) B = c...

environ 2 mois ago | 0

| accepted

Answered

clustering nearest 5 elements of a data

You could do the following which is to find the 5 minimum absolute differences for each element in core. [~,idx] = mink(abs(dat...

clustering nearest 5 elements of a data

You could do the following which is to find the 5 minimum absolute differences for each element in core. [~,idx] = mink(abs(dat...

environ 2 mois ago | 1

| accepted

Answered

Merge all rows in a cell into one row

Similar to numeric arrays writting NewC2LatLon(:) returns all the all elements of the array in a single column. However, I think...

Merge all rows in a cell into one row

Similar to numeric arrays writting NewC2LatLon(:) returns all the all elements of the array in a single column. However, I think...

environ 2 mois ago | 0

| accepted

Answered

find mean of 2d slice in 3d segmented volume

Ok I think I know what you want. Looking at the documentation for roipoly, I assume you got a binary image representing the regi...

find mean of 2d slice in 3d segmented volume

Ok I think I know what you want. Looking at the documentation for roipoly, I assume you got a binary image representing the regi...

environ 2 mois ago | 0

Answered

Finding the closest point on a line to another point

Solving for the discrete points is actually a lot easier. Using your data as follows: line.x = [1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5,...

Finding the closest point on a line to another point

Solving for the discrete points is actually a lot easier. Using your data as follows: line.x = [1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5,...

2 mois ago | 0

| accepted

Answered

summing elements of an array until a value appears

Say your array is called data: q=2; data = [1 2 3; 1 3 2; 2 1 3; 1 0 3; 1 2 2]; % Includes rows without any values = q, and re...

summing elements of an array until a value appears

Say your array is called data: q=2; data = [1 2 3; 1 3 2; 2 1 3; 1 0 3; 1 2 2]; % Includes rows without any values = q, and re...

2 mois ago | 0

Answered

Matlab corresponding values between matrices?

This will show values of B that exist in A and which are also less than N. result = B(ismember(B,A) & B<N) If you need find ...

Matlab corresponding values between matrices?

This will show values of B that exist in A and which are also less than N. result = B(ismember(B,A) & B<N) If you need find ...

2 mois ago | 0

Answered

Unexpected output form intersect (polyxpoly)

When you're using intersect to do what you have described you need to ensure you have inputs of either two polyshapes, a polyvec...

Unexpected output form intersect (polyxpoly)

When you're using intersect to do what you have described you need to ensure you have inputs of either two polyshapes, a polyvec...

2 mois ago | 1

Answered

How to write a loop for this case?

I was also taking the route of putting them into a structure with a fieldname for each month. months = {'Jan','Feb','Mar','Apr'...

How to write a loop for this case?

I was also taking the route of putting them into a structure with a fieldname for each month. months = {'Jan','Feb','Mar','Apr'...

2 mois ago | 1