Respondida
How do i add a seed
See <Controlling-random-number-generation> for discussion and links to rng function if it is needed to modify default seed to be...

alrededor de 6 años hace | 0

Respondida
How to read gaps from an Excel in MATLAB
It's readmatrix probably that's the problem as it is designed for matrix input and you have what looks like two (or several) mat...

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

| aceptada

Respondida
Changing the range of values in a Matrix
E=2*pi/3500*E-pi;

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 2

| aceptada

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

alrededor de 6 años hace | 1

| aceptada

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 1

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 1

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

alrededor de 6 años hace | 0

Cargar más