Answered
Remove the legends for some lines in a plot
If you only want the scatter points in legend, set the 'Annotation' property to not show the lines... plot(fittedX, fittedY...

6 years ago | 0

Answered
Matlab command for plotting complex number?
See https://www.mathworks.com/help/matlab/creating_plots/plot-imaginary-and-complex-data.html

6 years ago | 0

| accepted

Answered
Merge datetime with another cell for export
Sure... >> c={datetime(now,'ConvertFrom','datenum'),pi} c = 1×2 cell array {[25-Jun-2020 08:22:52]} {[3.14]} >> wr...

6 years ago | 0

| accepted

Answered
How to combine 2 Fits done with cftool
%% Fit: 'untitled fit 1'. [xData1, tmp] = prepareCurveData( Fqr, Prem ); yData1 = tmp+pi/2; % Set up fittype and options. ...

6 years ago | 0

| accepted

Answered
How to compare the colums ( 2nd and 3rd) of 2 .csv files based on a condition
Has to be a more direct way, but following works if I understand the request -- tF1=readtable('file1.csv'); tF1.condition=categ...

6 years ago | 0

Answered
How to add the year to the stairs plot
Use a datetime for your time variable and you'll get time plots automagically along the x axis and can set xlim() values with da...

6 years ago | 0

Answered
I want to plot Linear Equations but dont know how to do it on matlab
Since you're still new, let me make some suggestions on coding -- First, use newer features -- if you'll read the doc for xlsre...

6 years ago | 0

Answered
Speed up FFT calculation
"The signal matrix is 36350x2048, 36350 being the number of signals and 2048 being the zero padded length of each signal. " Use...

6 years ago | 0

| accepted

Answered
Error when trying to plot multiple box plot's in the same graph.
Your orientation for kcnt1Table is wrong -- as is you'll have 13 boxes, not six; boxplot treats each column as variable. You do...

6 years ago | 0

| accepted

Answered
Calculate average for each hour in day
IIUC, retime is not the tool for this; it bins data into desired time segments such as hourly but averages within those bins. T...

6 years ago | 1

| accepted

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

6 years ago | 0

| accepted

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

6 years ago | 0

| accepted

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

6 years ago | 1

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

6 years ago | 0

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

6 years ago | 0

| accepted

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

6 years ago | 0

| accepted

Answered
percentage of up days every 12 days
However, the neatest solution is probably nD=12; % number days for moving percentage dCP...

6 years ago | 0

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

6 years ago | 1

| accepted

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

6 years ago | 0

Answered
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'...

6 years ago | 0

| accepted

Answered
How can I assign a variable to a string?
>> whos -file simplu Name Size Bytes Class Attributes T - 1440 table ...

6 years ago | 0

| accepted

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

6 years ago | 0

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

6 years ago | 0

| accepted

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

6 years ago | 0

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

6 years ago | 1

| accepted

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

6 years ago | 0

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

6 years ago | 1

| accepted

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

6 years ago | 1

| accepted

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

6 years ago | 1

| accepted

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

6 years ago | 0

| accepted

Load more