統計
All
Feeds
回答済み
How to classify shapes of this image as square, rectangle, triangle and circle?
Another approach is to calculate the best-fit bounding rectangle of each object, such that the bounding rectangle can be oriente...
How to classify shapes of this image as square, rectangle, triangle and circle?
Another approach is to calculate the best-fit bounding rectangle of each object, such that the bounding rectangle can be oriente...
11年弱 前 | 6
| 採用済み
質問
Determine which function was used to generate hggroup?
Hello everyone, Is there a way to determine which function (e.g., quiver(), scatter(), contour(), etc.) was used to generate ...
11年弱 前 | 1 件の回答 | 0
1
回答回答済み
How to average a column based on another column?
This is a good use of accumarray(): [ud,ix,iy]=unique( data(:,1)); output = [ud, accumarray(iy,data(:,2),[],@mean)...
How to average a column based on another column?
This is a good use of accumarray(): [ud,ix,iy]=unique( data(:,1)); output = [ud, accumarray(iy,data(:,2),[],@mean)...
11年弱 前 | 0
| 採用済み
回答済み
How can I write a program to investigate whether a number belongs to matrix?
I think ismember() should do the trick: A=[1 2 3 5 21 2 4 0 11 3]; B = 11; C = ismember(B, A); %returns 1 B =...
How can I write a program to investigate whether a number belongs to matrix?
I think ismember() should do the trick: A=[1 2 3 5 21 2 4 0 11 3]; B = 11; C = ismember(B, A); %returns 1 B =...
11年弱 前 | 2
| 採用済み
回答済み
Creating an array of datenum(s)
If I understand you correctly, this should do it: [~, time_index] = ismember( datenum(tv), second_tv);
Creating an array of datenum(s)
If I understand you correctly, this should do it: [~, time_index] = ismember( datenum(tv), second_tv);
約11年 前 | 0
回答済み
How to convert an image from rgb to lab by pixel by pixel matrix???
You can convert rgb to L*A*B colorspace using the makecform() and applycform() functions. From the documentation: cform...
How to convert an image from rgb to lab by pixel by pixel matrix???
You can convert rgb to L*A*B colorspace using the makecform() and applycform() functions. From the documentation: cform...
約11年 前 | 0
回答済み
Is there a way to disconnect lines between data points while utilizing the plot function?
Another way is to insert a NaN between the dis-connected points, such as: x = [1;2;3;4;5;6;7;8;6]; y = [10;20;30;40;50;6...
Is there a way to disconnect lines between data points while utilizing the plot function?
Another way is to insert a NaN between the dis-connected points, such as: x = [1;2;3;4;5;6;7;8;6]; y = [10;20;30;40;50;6...
約11年 前 | 7
回答済み
How to calculate the median for each day of the year in 91 years?
I think this is a good use of accumarray(). %some sample data, to illustrate approach Data = [1915 1 1 1000 1010; ...
How to calculate the median for each day of the year in 91 years?
I think this is a good use of accumarray(). %some sample data, to illustrate approach Data = [1915 1 1 1000 1010; ...
約11年 前 | 0
回答済み
Finding minimum point from any function file input.
I would check out the documentation for fminsearch() and fminbnd(), or if you have the Optimization Toolbox, fminunc(): doc...
Finding minimum point from any function file input.
I would check out the documentation for fminsearch() and fminbnd(), or if you have the Optimization Toolbox, fminunc(): doc...
約11年 前 | 0
回答済み
How do I find values in a matrix which are closest to an integer which is the product of a given value?
I think I get what you are trying to do. I think the easiest way might be to use interpolation to fill in the missing values, as...
How do I find values in a matrix which are closest to an integer which is the product of a given value?
I think I get what you are trying to do. I think the easiest way might be to use interpolation to fill in the missing values, as...
約11年 前 | 1
| 採用済み
回答済み
Read data from text file
You should be able to do it with textscan fid = fopen('/path/to/your/file.txt', 'rt'); output = textscan(fid, '%s %s %f ...
Read data from text file
You should be able to do it with textscan fid = fopen('/path/to/your/file.txt', 'rt'); output = textscan(fid, '%s %s %f ...
約11年 前 | 3
回答済み
and another "if" statement question
How long is the vector? Would this work? if all(A>3) %do something else %do other thing end
and another "if" statement question
How long is the vector? Would this work? if all(A>3) %do something else %do other thing end
約11年 前 | 1
| 採用済み
回答済み
how to get some values from many text files and put them into the calculation ( please help)
One approach using regular expressions: %variables to average over AveVariables = {'Area', 'xbar', 'ybar', 'IXXw', 'IYY...
how to get some values from many text files and put them into the calculation ( please help)
One approach using regular expressions: %variables to average over AveVariables = {'Area', 'xbar', 'ybar', 'IXXw', 'IYY...
約11年 前 | 0
| 採用済み
回答済み
how to write program for following problem
I'm not going to given you the entire code, but to get you started, here's how you can do the parse: a = 'AD''BA''C'''; %...
how to write program for following problem
I'm not going to given you the entire code, but to get you started, here's how you can do the parse: a = 'AD''BA''C'''; %...
約11年 前 | 0
回答済み
levenberg-marquardt in lsqcurvefit
Pass in an options structure: opts = optimset('Algorithm', 'levenberg-marquardt'); [parameters,resnorm,residual,exitflag...
levenberg-marquardt in lsqcurvefit
Pass in an options structure: opts = optimset('Algorithm', 'levenberg-marquardt'); [parameters,resnorm,residual,exitflag...
11年以上 前 | 0
| 採用済み
回答済み
Updating bounds in fmincon
You can implement the constraints on psi as a linear inequality constraint. If you check the documentation for your solver (e.g....
Updating bounds in fmincon
You can implement the constraints on psi as a linear inequality constraint. If you check the documentation for your solver (e.g....
11年以上 前 | 1
回答済み
How do I create variable names from string variables
If you can, avoid doing this. This explains why: <http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA...
How do I create variable names from string variables
If you can, avoid doing this. This explains why: <http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA...
11年以上 前 | 2
| 採用済み
回答済み
Creating a matrix using a loop
[xx,yy]=ndgrid( -2:1:2, -2:1:2); xy = [xx(:), yy(:)]; x = xy(:,1); y = xy(:,2);
Creating a matrix using a loop
[xx,yy]=ndgrid( -2:1:2, -2:1:2); xy = [xx(:), yy(:)]; x = xy(:,1); y = xy(:,2);
11年以上 前 | 1
| 採用済み
回答済み
How to Multiply value in adjacent cell by cell above, Autofil formula in Matlab?
There is no generic "autofill" command. For the example you've given, the following logic would work: StartVar = 5; mult...
How to Multiply value in adjacent cell by cell above, Autofil formula in Matlab?
There is no generic "autofill" command. For the example you've given, the following logic would work: StartVar = 5; mult...
11年以上 前 | 1
| 採用済み
回答済み
using multiselect uigetfile with dicomread
You probably need to pass in the full path to your DICOM file to dicomread(). Try this: for count = 1:numel(name) imag...
using multiselect uigetfile with dicomread
You probably need to pass in the full path to your DICOM file to dicomread(). Try this: for count = 1:numel(name) imag...
11年以上 前 | 1
| 採用済み
回答済み
Error using textread to read data containing "INF" or "NaN" with float data
Try using textscan() with the 'TreatAsEmpty' option: output = textscan([direct filename], '%22c %u %f %f %f %f %f %f %f %f ...
Error using textread to read data containing "INF" or "NaN" with float data
Try using textscan() with the 'TreatAsEmpty' option: output = textscan([direct filename], '%22c %u %f %f %f %f %f %f %f %f ...
11年以上 前 | 2
回答済み
How to read from a *.txt file to assign variables and paths
Easiest way is to parse with regular expressions and read into an output structure with named fields. %read in file str ...
How to read from a *.txt file to assign variables and paths
Easiest way is to parse with regular expressions and read into an output structure with named fields. %read in file str ...
11年以上 前 | 0
| 採用済み
回答済み
Solving ODEs using matlab (ode45)
Did you forget the assignment sign? [T, XY] = ode45 ('diffxy', 0 10, [0 1 0])
Solving ODEs using matlab (ode45)
Did you forget the assignment sign? [T, XY] = ode45 ('diffxy', 0 10, [0 1 0])
11年以上 前 | 0
回答済み
choose data points that nears each other and store in different matrix
One (non-loop) way: [x1,x2]=meshgrid(A(:,1)); [y1,y2]=meshgrid(A(:,2)); D = sqrt((x1-x2).^2+(y1-y2).^2); %distance m...
choose data points that nears each other and store in different matrix
One (non-loop) way: [x1,x2]=meshgrid(A(:,1)); [y1,y2]=meshgrid(A(:,2)); D = sqrt((x1-x2).^2+(y1-y2).^2); %distance m...
11年以上 前 | 0
| 採用済み
回答済み
rotate 3D plane to a new 2d coordinate system
Simplest way is just using a transformation matrix. %assume points are Nx3, where N is number of points. %let first poin...
rotate 3D plane to a new 2d coordinate system
Simplest way is just using a transformation matrix. %assume points are Nx3, where N is number of points. %let first poin...
11年以上 前 | 1
| 採用済み
回答済み
How can I extract the first non-zero in several specific segments of the same matrix?
ix1 = find(x(1:3,2),1,'first'); %index of first non-zero in x(1:3,2); x1 = x(ix1,1); %corresponding first-column value ...
How can I extract the first non-zero in several specific segments of the same matrix?
ix1 = find(x(1:3,2),1,'first'); %index of first non-zero in x(1:3,2); x1 = x(ix1,1); %corresponding first-column value ...
11年以上 前 | 0
| 採用済み
回答済み
Saving outputs to different folder than m-file.
%get the directory of your input files: pathname = fileparts('/input/file'); %use that when you save matfile = fullfi...
Saving outputs to different folder than m-file.
%get the directory of your input files: pathname = fileparts('/input/file'); %use that when you save matfile = fullfi...
11年以上 前 | 3
| 採用済み
回答済み
I need to remove every other 9 rows of a matrix
So, to confirm, you need to do the following: * remove rows 1-9 (9 rows) * retain rows 10-19 (10 rows) * remove rows 20...
I need to remove every other 9 rows of a matrix
So, to confirm, you need to do the following: * remove rows 1-9 (9 rows) * retain rows 10-19 (10 rows) * remove rows 20...
11年以上 前 | 0
回答済み
how to count the no of words in a sentence?
txt = fileread('hello.txt'); %read in file, assuming it is not too big sentences = strtrim(regexp(txt, '[\.\?\!]+', 'split...
how to count the no of words in a sentence?
txt = fileread('hello.txt'); %read in file, assuming it is not too big sentences = strtrim(regexp(txt, '[\.\?\!]+', 'split...
11年以上 前 | 0
| 採用済み