Answered
What is the code for defining a binary array in Matlab?
IDL Data Types Data Type Description Type N...

8 years ago | 0

Answered
Where am I going wrong in my for loop? I am getting NaNs
... T_num = nan(length(z),length(t)); % initialized to NaN T_num(:,1) = T_av; %initial temperatur...

8 years ago | 0

Answered
Averaging second data to minute data
Convert to |timetable| and use |retime| tt_secs=array2timetable(data(:,2),'rowtimes',datetime(data(:,1))); % convert to ti...

8 years ago | 0

Answered
How to import .dat data
fid=fopen('yourfile.dat','r'); data=cell2mat(textscan(fid,'','CollectOutput',1,'CommentStyle','#')); fid=fclose(fid); ...

8 years ago | 1

| accepted

Answered
I have a given set of data and will like to do a distribution fitting (for gamma and lognormal) and return a P-P plot. What matlab function is best suited for this?
See doc probplot % <https://www.mathworks.com/help/stats/probplot.html> There are many builtin distribution functions un...

8 years ago | 0

Answered
How to assign values to a sparse matrix without iterations?
S=sparse(Nonloc(:,1),Nonloc(:,2),1);

8 years ago | 0

Answered
Counting occurrences of each column in a matrix
Several ways to do this; probably easiest is via converting to |categorical| with the |unique| values in each column transformed...

8 years ago | 0

Answered
How can I compute multivariate regression residuals?
You really have 1939 _different_ regressions or 1939 _observations_? Whichever, you get only one (the last) result the way th...

8 years ago | 0

Answered
Extracting numbers from mixed string
v=str2double(strip(splitstr(s,'_'),'m')); % chuckles... In reality, write a |regexp| expression is the more general so...

8 years ago | 0

Answered
what is the code for the default blue color for 2D plot?
>> get(groot,'defaultAxesColorOrder') ans = 0 0.4470 0.7410 0.8500 0.3250 0.0980 0.92...

8 years ago | 1

| accepted

Answered
how to populate a cell with a loop
fmt=[repmat('%f',1,14) repmat('%s',1,2) repmat('%f',1,29) repmat('%s',1,2) repmat('%f',1,8)]; % legible (sorta') format stri...

8 years ago | 0

| accepted

Answered
How to read a txt and store specific line in matrix
fmt1='mode%n'; fmt2=['(' repmat('%f',1,3) ')']; flds={'X','Y','Z'}; fid=fopen(fname,'r'); dat=struct([]); i=0; ...

8 years ago | 0

| accepted

Answered
problems with function "find". matlab doesn't match two numbere which are built equal
dt = 1/fs; data= [data0; data1; data2]; time= 0:dt:(length(data)-1)*dt; is the root of the problem; can be demonstrat...

8 years ago | 0

| accepted

Answered
single trendline for multiple series
Sure, just group all the independent and dependent data arrays into one long vector for each. Presuming you have X,Y arrays s...

8 years ago | 0

Answered
extract date and time preceded by strings with variable length from text file
fmt='%f%s%{yyyy-MM-dd HH:mm:ss}D%f%f'; dat=textscan(fid,fmt,'delimiter','\t','whitespace',''); This is directly related ...

8 years ago | 0

| accepted

Answered
What is missing from MATLAB?
Neither |textscan| nor |readtable| can handle _'X'_ format string; whassup w/ that? Why are hex data presumed to not be in te...

8 years ago | 0

Answered
Date and Time Extraction for individual data points from patient monitor device
See <https://www.medicollector.com/medicollector-blog/how-to-access-data-in-medicollector-files-without-exporting medicollector-...

8 years ago | 0

| accepted

Answered
How to extract the x,y and z coordinate points from NC code?
fmt='N%fX%fY%f'; fid=fopen('yourtextfile.ext','r'); NXY=cell2mat(textscan(fid,fmt,'collectoutput',1)); fid=fclose(fid...

8 years ago | 0

Answered
How could you write a function that returns a histogram with axis labels and title
|hist| when save the return value only returns the counts vector and, as you've discovered; doesn't actually draw the plot. T...

8 years ago | 0

Answered
How to normalize a matrix such that each column sums equal 1
You're missing the "dot" operator so the division is matrix divide not element-wise. See doc ./ doc rdivide % that's a ...

8 years ago | 1

| accepted

Answered
Passing functions in MATLAB
Look at function handles; there's a section under _Data Types_ in the documentation...

8 years ago | 0

Answered
How to read a comma delimited .dat file containing mixed formats
Just read the file as it's given then parse the data columns... t=readtable('couzi.csv','ReadVariableNames',0,'Delimiter','...

8 years ago | 0

| accepted

Answered
How to export coefficients names when using rstool?
Real issue with the Matlab user interface for most of the Curve Fitting and Statistics Toolbox stuff -- frequently it is very di...

8 years ago | 0

| accepted

Answered
How do i convert Julian date to Month date?
s='2018-107T18:49:39.164'; infmt=['uuuu-D''T''H:m:s.SSS']; fmt='dd MMM yyyy HH:mm.ss.SSS'; >> t=datetime(s,'Input...

8 years ago | 1

Answered
Using regular expression to read part of the filename
*AMMENDED -- dpb* Don't need regular expressions for that purpose, just select the first N-3 characters in the file name... ...

8 years ago | 0

Answered
convert excel datetime to time in matlab
Specific file always helps as Walter suggests, but try a=datetime(xlsread(fileName,'C3:C30000'),'convertfrom','excel'); a....

8 years ago | 1

Answered
how can i install matlab 2018b (64 bit) on my window (32 bit).
No can do. R2015b was the last 32-bit version. <https://www.mathworks.com/support/sysreq/previous_releases.html> <ht...

8 years ago | 0

Answered
Read excel comments into Matlab
Try this as starter--it's a routine I built to process some data stored as comments on a worksheet for the local community colle...

8 years ago | 0

Answered
Matrix subtraction errors using repmat
# You can subtract/add/multiply/divide any sized array with a scalar without |repmat| so you're "fixing" a problem that isn't a ...

8 years ago | 0

Answered
Plotting very small and large values on same figure.
Look at doc yyaxis to put the two on separate axes that will cover range of each variable independently for starters, at...

8 years ago | 0

| accepted

Load more