Réponse apportée
How to simplify the for loops and if statement in this code
Straightahead w/o trying to save some recomputations that could be done by complements-- k=[sum(A==B & A==0,'all') sum(A==B & A...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Creating a mesh plot with data in a timetable
OK, the above conversation branched another route -- time=datenum(Time); % convert to datenum since they're doubles...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Using bar3 and color coordinating the height depending on the value
They're all the faces color vertices data -- it's a convolved mess to fiddle with manually, fer shure, good buddy! :( Your cod...

environ 6 ans il y a | 1

Réponse apportée
Creating a mesh plot with data in a timetable
That form for meshz doesn't use any x-,y-coordinates at all -- it just plots against the ordinal position numbers of the Z array...

environ 6 ans il y a | 0

Réponse apportée
extract year from date and add to a table
Nothing, really. It's an undocumented edge case of incorrect input to the function datenum that for some reason instead of thro...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
How i accumulate multiple variables?
out=out(:); % just reshape to column vector Use k=2*(i-1)+j; % for index vector where i,j ==> a(:,1), a(:,2), resp...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
percentage of up days every 12 days
However, the neatest solution is probably nD=12; % number days for moving percentage dCP...

environ 6 ans il y a | 0

Réponse apportée
Converting C++ to MATLAB: statement
A[index1d(x,y,z)] = A[index1d(x,y,z)] + B[i]*W; in C/C++ Presuming conformance of dimensions, etc., A(index1d(x,y,z)) = A(i...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
percentage of up days every 12 days
"counting the numbers of up market taking the the first closep(2:13) then (3:14) then (4:15) and so on..." OK, so a running num...

environ 6 ans il y a | 0

Réponse apportée
Acquiring corresponding Columns of Data when a condition is met
Recommend readtable for disparate data -- much easier to handle variables of different types... tSample=readtable('Sample.xlsx'...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
How can I assign a variable to a string?
>> whos -file simplu Name Size Bytes Class Attributes T - 1440 table ...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
How to write function for above combine matrix?
" want above pattern, matrix size is [21,3]." ADDENDUM/ERRATUM: [But we have now learned that that is NOT even the correct des...

environ 6 ans il y a | 0

Réponse apportée
hello everyone, I am using rectpuls function to generate a bandpass filter. I got a rectangle with a width at the top different from that at the bottom. anyone can help please!!
>> find(F1firsthalf,1) ans = 509 >> F1firsthalf(505:515) ans = 0 0 0 0 1 1 1 1 1 ...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
how to find solution for the error "Index exceeds the number of array elements (1)"?
"the f_pbest become 1*1 matrix which leads to this error. I dont know how the size of the matrix is changing." Because you told...

environ 6 ans il y a | 0

Réponse apportée
How can I found character in a 2D array
The simplest way I can think to code would be is_existing=ismember(sort(Y,2),sort(X,2),'rows'); or is_existing=contains(strin...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
Sorting rows only with name of column
ttmp=[table(datetime(string(Datetime),'InputFormat','MM-dd-yy','PivotYear',1900)) array2table(Var)]; >> [~,ix]=sort(ttmp{:,2:...

environ 6 ans il y a | 0

Réponse apportée
Understanding FFT Results from Excel Data
See <Answers/395585-normalize-fft-signal> It goes through a complete example including computing the associated frequency vecto...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
Obtaining the P values for the t stat
p = 1-tcdf(t,n-1) % Probability of larger t-statistic requires Statistics Toolbox...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
Plotting Points on Map with Longitude and Latitude
I don't have the Mapping TB so can't test, but looks like just hold on lat= 40.9394; lon=-100.151; plotm(lat,lon,'r*') wou...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
readtable and readtimetable can't load timezone properly?
What worked here for R2019b >> opt=detectImportOptions('thing.csv','delimiter',',') opt = DelimitedTextImportOptions with ...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
How to find peaks in a for loop where the number of peaks are not the same for every vector in matrix?
That's when cell arrays are useful... for i=1:size(CH1WaveForm_1,2) [pks{i},locs{i}]=findpeaks(CH1WaveForm_1(1:end,i)); en...

environ 6 ans il y a | 2

| A accepté

Réponse apportée
Printing the values on the .csv file
In your program you'll have to create a table of the names/categories and the breakpoints that is associated with them and then ...

environ 6 ans il y a | 0

Réponse apportée
Find Time when two conditions are met in two colomns
Really don't need the applied signal at all to answer the Q?... data=load('Data1.txt'); [Imx,iImx]=max(data(:,3)); ...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Use string or character arrays in code?
It's all about what's more convenient for the purpose...char() is most memory efficient, but one has to always drag around and r...

environ 6 ans il y a | 0

Réponse apportée
Count number of values within a range in matrix per column and assign count to new matrix
>> reshape(cell2mat(arrayfun(@(c) histcounts(A(:,c),[0 0.5 1]),1:size(A,2),'UniformOutput',false)),[],size(A,2)) ans = ...

environ 6 ans il y a | 0

Réponse apportée
How can I analyse particular portions of an array to use for plotting? Considering dataset of ~1.5 million rows for each variable and ~150,000 locations with 10 values (for each variable) per location
"I’ve imported the data from a table and converted each variable into their own individual arrays,..." That's exactly the wrong...

environ 6 ans il y a | 0

Réponse apportée
select complex numbers from cell array based on the real part
Well, if you want the max() of the real part, then you'll have to limit to only looking at the real part -- max() for complex re...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Put a cell into a title in plot
Sr=regexp(fileread('data.txt'), '\r?\n', 'split') .'; % reads as a string, not numeric for i=1:size(St); ...

environ 6 ans il y a | 0

Réponse apportée
How to sort a two column vector
s=sortrows(x);

environ 6 ans il y a | 1

Réponse apportée
Avoid +0 when using fprintf %+d
Not w/o some code logic of one form or the other, no. There is no "magic bullet" format descriptor that behaves as desired; as ...

environ 6 ans il y a | 2

| A accepté

Charger plus