Respondida
Read only numerical values from mixed text file
Something like fmt1='NODes %n ELEments %n'; % info line nodes, elements in file fmt2=repmat('%f',1,4); fmt3=repmat('...

más de 7 años hace | 0

Respondida
Index on a matrix
xlo=0.000020; xhi=0.000025; d=dir('*.csv'); nFiles=numel(d); % how many are there? vt=zeros(nF...

más de 7 años hace | 0

Respondida
How to copy first column, and replace other columns with this first column values in same array in MATLAB? (array size can vary)
"copy what ever is in the first column (first column will have each row with different values and have n number of rows in it), ...

más de 7 años hace | 0

| aceptada

Respondida
Multivariate regression betas stock returns
OK, just add as new Answer since preceding getting rather long...try this out; seems to work ok here on the sample dataset. NB:...

más de 7 años hace | 0

| aceptada

Respondida
Print OCR results to text file
AHA! The one about "Expected one output from a curly brace or dot indexing expression, but there were 544 results." is helpful!...

más de 7 años hace | 0

Respondida
Multivariate regression betas stock returns
Just saw something overlooked last night... if size(vars,1) > 15 I think there's your problem -- you only calculate a re...

más de 7 años hace | 0

Respondida
How to Convert this time series data to YYYY-MM-DD HH:MM format
dt=datetime(Year,1,day,fix(time/100),mod(time,100),0); ADDENDUM: Using Star's array... A = [2019 137 1650; 2019 144 1740]; ...

más de 7 años hace | 0

Respondida
Print OCR results to text file
To write cell output with fprintf, you must dereference the cell content "use the curlies, Luke!". fprintf(fileID, '%s\r\n', te...

más de 7 años hace | 0

Respondida
how to create a normal distribution matrix?
NRV=normrnd(0,1,120*320,1); NRV=reshape(interp1([min(NRV);max(NRV)],[0;255],NRV),120,[]);

más de 7 años hace | 1

Respondida
Transfer formula and images from Excel to Matlab
You'd have to use COM to drive Excel to read formulae from cells or, alternatively, for a couple cases where needed to get such ...

más de 7 años hace | 0

Respondida
Set individual bar color, with specifying y axis range and show tick as well.
To set individual bar colors-- hBar=bar(tensile); % do the bar plot, save the handle hBar.FaceColor='flat'; ...

más de 7 años hace | 0

Respondida
How to supplement the matrix?
Adding to Stephen's answer Matlab syntax, the crystal ball says for i = 1:length(d)-1 % Error 1100 1099 if g(i)-50>= g(i...

más de 7 años hace | 0

Respondida
How can I merge a numeric matrix (1 column) to an existing numeric matrix?
Presuming the B vector already exists to match the right size, simply knowing the row number is sufficient... B(sc:end,2)=A;

más de 7 años hace | 0

| aceptada

Respondida
plot with two datetick axis
Don't use datenum and datetick, use datetime instead for which plot has builtin support. You should be able to create two indep...

más de 7 años hace | 0

Respondida
Pairwise difference of datetime vectors (i.e. pdist for time data)
Presuming not excessive precision, one could convert to datenum, compute distances and then return to datetime Seems like a fea...

más de 7 años hace | 1

Respondida
Can I use Matlab to read in data that's in an unusual layout
A little tedious to set up, but easily-enough handled for a regular file format such as this. First you have to either know the...

más de 7 años hace | 1

| aceptada

Respondida
What are the methods and corresponding functions in matlab to fill missing data temporally in rainfall timeseries?
Well, time-based was understood the point of the Q? was whether you were also requesting some specific and recognized in the fie...

más de 7 años hace | 0

Respondida
Find column with error and delete it
isStr=find(cellfun(@isstr,table2cell(dataFromTable(1,:)))); if(cell2mat(strfind(dataFromTable{1,isStr},'$$ER'))) dataFromTab...

más de 7 años hace | 0

Respondida
What data points does interp1 use for linear interpolation?
inter1 does linear interpolation between points unless you use 'nearest'|'next''|'previous' for the method. It also requires th...

más de 7 años hace | 0

Respondida
Help!!! how to search for some xx xx xx xx(hex) in a dat file very fast!!!
If it's performance you're looking for, pass the job off to a grep utility...there are any number of freeware versions available...

más de 7 años hace | 0

Respondida
Convert String Array to Numeric matrix and string array
EventVals=str2double(data_events(1:2:end,:)); EventCmnt=data_events(2,:);

más de 7 años hace | 1

Respondida
Stacked bar graph with secondary y-axis line graph
[~,~,r]=xlsread('MLQ.xlsx'); % just read the spreadsheet to see what was in it... MLQopt=detectImportOptions('MLQ....

más de 7 años hace | 0

| aceptada

Respondida
How to access names of external drive from path?
That's an OS command -- on Windows there's "VOL" >> !vol Volume in drive C is OS Volume Serial Number is ... >>

más de 7 años hace | 0

| aceptada

Respondida
fread() help. "Error using fread: Invalid file identifier..."
[filename, pathname]=uigetfile('*.ptu', 'T-Mode data:'); %Opens dialog box to manually select the file using file explorer ...

más de 7 años hace | 1

| aceptada

Respondida
Customizing MATLAB Plots and Subplots
The new(ish) yyaxis function to arbitrarily create two y axes and then switch between left and right axes w/o the need of yyplot...

más de 7 años hace | 0

| aceptada

Respondida
Select specific data from txt file
Just read the file into memory and do a find() -- since it's an integer that'll be exact. What do you do if there isn't a matc...

más de 7 años hace | 0

Respondida
What Is A Scalar String?
A scalar string is simply a string that is not an array of strings...see https://www.mathworks.com/help/fixedpoint/ug/code-gener...

más de 7 años hace | 0

| aceptada

Respondida
for loops not working
"The MATLAB way" is to avoid the loops altogether... N=10; M=1000; [X,Y]=meshgrid([1:N],1:M]); func=(X*pi/Lx).^2 +(Y*pi/Lz).^...

más de 7 años hace | 0

Cargar más