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

7 years ago | 0

Answered
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,[]);

7 years ago | 1

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

| accepted

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

7 years ago | 0

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

7 years ago | 1

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

7 years ago | 1

| accepted

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 1

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

7 years ago | 0

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 1

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 0

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

7 years ago | 0

| accepted

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

7 years ago | 0

Answered
How can I shift the elements in a vector without losing the elements? just shift the order
Sorta' inconsistent definition, but look at >> A=1:10; >> circshift(A(4:end-2),-2) % case 1 ans = 6 7 ...

7 years ago | 0

Answered
How to transform an array into a bottom triangle
On the above assumption, if V is the vector, then N=149; % array size parameter R=V(cumsum([N:-1:1])); ...

7 years ago | 0

| accepted

Answered
Finding elements of an arrays having specified index numbers
Given you return the indices in vectors ix and iy, then V=A(sub2ind(size(A),ix,iy)); where A is the other array and V will be ...

7 years ago | 2

| accepted

Answered
Use the index of an element of a subset to find its index in the large set?
tipPt=[2 3 2]; % the two located points smpPt=[2 3 1]; % return their locations in the two arrays, respectively ...

7 years ago | 0

| accepted

Answered
vertical error bar in loglog plot
hEB=errorbar(x,A,err); hAx=gca; hAx.XScale='log'; hAx.YScale='log'; You'll have to have defined the error magnitude array, e...

7 years ago | 0

| accepted

Answered
Having multiple lines in a character array for column labels in a heatmap
Unless TMW has finally fixed it, the TickLabel interpreter is pretty brain dead...you can do something like ColumnLabels=strrep...

7 years ago | 0

| accepted

Answered
Replace categorical value with numeric values
If categorical variable is c, then d=double(c)-1; presuming didn't define them except by default which will be in alphanumeric...

7 years ago | 0

Load more