Réponse apportée
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...

plus de 5 ans il y a | 0

Réponse apportée
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...

plus de 5 ans il y a | 0

Réponse apportée
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!

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 5 ans il y a | 0

Réponse apportée
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...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
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 ...

plus de 5 ans il y a | 0

Réponse apportée
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...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
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: "...

plus de 5 ans il y a | 0

Réponse apportée
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...

plus de 5 ans il y a | 1

Réponse apportée
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...

plus de 5 ans il y a | 0

Réponse apportée
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...

plus de 5 ans il y a | 0

Réponse apportée
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.

plus de 5 ans il y a | 1

Réponse apportée
can anyone please explain X0(1:2) where X0=[0,0,0]' , i wrote X0(2:2) and gave answer 0 i tht it shoudl give error . what i understand is X0(1:2) is 1 row 2 element. please correct me
Linear addressing. Arrays are stored in column-major order. See https://www.mathworks.com/help/matlab/math/array-indexing.html...

plus de 5 ans il y a | 0

Réponse apportée
Issues with power spectral density calculation of linear ramp
y=detrend(y);

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Read from Excel file as a plain table
[~,~,r]=xlsread('yourfile.xls'); will return a cell array r that is a duplicate of the spreadsheet content with no interpretati...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
SELECT SPECIFIC VALUES FROM AN ARRAY
Presuming from the above you have the cellstr array given, using the simplified string-matching functions, one solution would be...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
How to select specific data from one matrix and place it in another
The following can be optimized, but if I understand you want the data reordered by hour for each day, then the basic idea for an...

plus de 5 ans il y a | 0

Réponse apportée
RMS value of non-sinosoidal current
r=rms(x);

plus de 5 ans il y a | 0

Réponse apportée
How to flip heatmap Y axis
hHM=heatmap(table,'x','z','ColorVariable','value'); % make heatmap, keep handle hHM.NodeChildren(3).YDir='normal'; ...

plus de 5 ans il y a | 4

| A accepté

Réponse apportée
how to cite a reference of matlab 2018 in research paper
Or https://www.mathworks.com/matlabcentral/answers/286213-how-can-i-cite-matlab-software-in-apa-style?s_tid=answers_rc1-1_p1_Top...

plus de 5 ans il y a | 0

Réponse apportée
Why does rem(Centnum,5) give me an answer that is not zero?
>> format long,format compact >> rem(Centnum,5) ans = 1.421085471520200e-14 >> 0.05 cannot be stored exactly in float...

plus de 5 ans il y a | 0

Réponse apportée
How to get (x,y) coordinates of a categorical bar graph?
To do the desired you've got two choices -- when you use a categorical variable, TMW has created a specific axes that is not num...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Data Analysis with uneven data lenghts
Substitute NaN for the missing values; plot() will silently ignore it. Since it appears there are no real zero values, you can ...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Trying to put a scatterplot onto a boxplot
" Both the X and Y variables I input into it are 16x4, ..." As the error message clearly says, Error using scatter (line 78) ...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Precision in writetable()
Sadly, no. A OutputFormat formatting string or NumericPrecision option is not available. I presume since a table can contain a...

plus de 5 ans il y a | 4

| A accepté

Réponse apportée
How to obtain such a plot?
contourf(X,Y,rhosS+2*rhoEm+3*rhoImPl+4*rhoPl) yields You can set colors as wish...just need to scale the overlapping por...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
plotting a graph with different conditions using if statement
What's the desired range for X? Read the "Getting Started" section on array indexing and operations... In short, in MATLAB if ...

plus de 5 ans il y a | 1

Réponse apportée
Reading Multiple Images Using For Loop
RGB=cell(4,1); gray=cell(4,1); Min_loc=cell(4,1); for i=1:4 RGB{i}=imread(sprintf('%d.jpg',i)); gray{i}=rgb2gray(RGB{i}...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Find cells with specific condition
First of all, not all elements of condition contain two elements so you'll have to special-case those or fix that anomaly. Use ...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
char to double data type
Deprecated (and not recommended) would be dn=datenum(yourdatechararray,'dd-mmm-yyyy'); which, of course, returns the datenum a...

plus de 5 ans il y a | 0

Charger plus