回答済み
Reduce loops to Vectors in Viola Jones Algorithm
I don't have the time right now, but the two inner loops should be replaceable by filter2 or conv2. NB: filter2 has an internal...

5年以上 前 | 0

回答済み
How would I be able to output ID's that satisfied an if statement?
Use logical indexing, "the MATLAB way". LIMIT=50; % don't put magic numbers inside code; use variables so can change ...

5年以上 前 | 0

回答済み
Two cell arrays indexing
C=cellfun(@(a,b)b(a),A,B,'UniformOutput',false); It's just logical indexing in a background loop under the guise of cell addres...

5年以上 前 | 0

| 採用済み

回答済み
How to plot over histogram function
>> figure(2) [h] = histogram(norm,100); ... Error using norm Not enough input arguments. >> Your code even if fix the abo...

5年以上 前 | 0

| 採用済み

回答済み
Changing the range of values in a Matrix
E=2*pi/3500*E-pi;

5年以上 前 | 0

回答済み
Numeric miscalculation on the 14th decimal place
MATLAB used double precision floating point for calculations which is good to roughly 15 decimal digits. Hence, when you subtra...

5年以上 前 | 2

| 採用済み

回答済み
Please answer! How to use an if function effectively?
colmn_analyze=4; % desired column to compare colmn_target=2; % desired column to set valLimit=2; % limiting val...

5年以上 前 | 1

| 採用済み

回答済み
i cant able to plot graph of this cord
y=@(x)c1*exp(-diff(x))+d*(sin(x)/(d^2+1))+d^2*(cos(x)/d^2+1); numel(diff(x)) is one less than numel(x) so the above will fail...

5年以上 前 | 0

回答済み
Is there a way to change the value of a variable within a function?
You can do anything you want inside the function as long as you can write a definition of what it is that is to happen. You cou...

5年以上 前 | 0

| 採用済み

回答済み
How to delete the first word in each line in txt file?
Read the file into string or cellstr array and extractAfter() the blank. Not feasible to do on disk; don't even think of trying...

5年以上 前 | 0

| 採用済み

回答済み
FilePath including a variable
Variables are variables, not text. rootdir="C:\Users\Desktop\Test\"; % use variable so can change easily filespec="*.txt";...

5年以上 前 | 0

回答済み
Convert 1X5 to 3X3
Probably more clever ways, but N=3; % number elements to duplicate A=a(1:N); % first row for i=2:numel(a)-(N-1) A...

5年以上 前 | 0

| 採用済み

回答済み
Function : undefined function or variable
"wrote a function fun in a "Vc.m" file" but the function function [Vc] = fun(j,b,m,R) Vc(j) = E0-b.*log(j)-R.*j-m.*exp(n....

5年以上 前 | 0

| 採用済み

回答済み
question regerding the print
Don't really understand the question/confusion... Live Scripts or Live Functions are just that -- they exist and can run only i...

5年以上 前 | 0

| 採用済み

回答済み
Problem Calling Data While Using Linear Regression Model 'fitlm'
"this is [p]ossibly due to the Species column being a string column..." That's exactly the problem. See Coding systems for ca...

5年以上 前 | 1

回答済み
How can I use the unique function to output all the different numbers following M from all the file names?
rootdir = '/Users/apple/Desktop/Project/Code/Data/'; % good! Using variable so can change: +1 d=dir(fullfile(rootdir,'*_dat...

5年以上 前 | 0

回答済み
function to calculate rows with non-missing data
Don't need to write any functions -- use ismissing and friends with, perhaps sum and maybe all, any could be of interest as well...

5年以上 前 | 0

回答済み
Kindly help me to find error in attached code to find leap years for a range
isleapyr=@(yr) (eomday(yr,2)==29);

5年以上 前 | 0

| 採用済み

回答済み
Preallocation of a vector of structure
You preallocated a double array and then tried to put a struct variable into it. As you discovered, "You can't do that!" There...

5年以上 前 | 0

回答済み
How to cross 2 matrixes, one column at a time?
C=cross(A,B); Like most other functions in MATLAB, cross operates in a vector sense. cross operates by default on the first di...

5年以上 前 | 0

回答済み
How to write a row of a matrix using if statement?
A=[ones(size(x1) x1 y1 x1.*y1]; B=[ones(size(x2) x2 y2 x2.*y2]; M=[A B]; Of course, numel(x1)==numel(x2) or all goes boom!

5年以上 前 | 0

| 採用済み

回答済み
How would I remove certain values of an array and put it into another array?
function [microbeInd, noLifeInd] = semTest(semData) microbeInd = islocalmax(semData); noLifeInd=semData(~microbeInd); end...

5年以上 前 | 0

回答済み
How to custom arrange a timetable
Well, that isn't all that is in the files.... >> tRaw=readtable('2019_Jan-Mar_DA_LMPs.csv'); >> head(tRaw) ans = 8×28 tabl...

5年以上 前 | 0

| 採用済み

回答済み
Extract columns from matrix based on a vectors values
>> A=[1,1,1,0; 2,1,0,1]; B=[3,4]; >> A(:,B) ans = 1 0 0 1 >> B=[3,1]; >> A(:,B) ans = 1 ...

5年以上 前 | 0

回答済み
trying to find an aproximate value in a data set
disp('I in (A), t in s, Idot in A/S') [Imax,Iloc] = max(I); tmax = t(Iloc); Idot_1 = Imax./tmax; disp([Imax tmax Idot_1]) I...

5年以上 前 | 0

| 採用済み

回答済み
How does FindPeaks works?
TMW doesn't reveal innards beyond what is in documentation so the answer is "we don't know". What the documentation says is: "...

5年以上 前 | 0

回答済み
fortran do loop to matlab
MATLAB is Fortran w/ DO --> for and CONTINUE --> end But, depending on what "somethings" are, you may well (and probably should...

5年以上 前 | 1

回答済み
How to convert a table to a 2d array
Don't make a cell array of tables to start with... x=[]; for i=1:data.numberofselected concatenated=strcat(strcat(strcat(fi...

5年以上 前 | 0

回答済み
How to cut out/delete rows in a cell
mu_mean_Mess_20kmh_HA=cellfun(@(c) mean(c(126:end,:)),mu_20kmh_all_VA); Don't need explicit loop; you just forgot the column co...

5年以上 前 | 0

回答済み
Matlab Arrays not populating correctly
You've got a typo... population.Chromosomes(M).Gene(:) = [rand, 0]; is writing into the location M(=10) every time.

5年以上 前 | 1

さらに読み込む