Answered
Extracting X Y values from a .txt file
You'll have to parse that file to locate the desired sections...none of the builtin reading tools are able to do such a file str...

8 years ago | 0

Answered
Specify a format character vector in readtable
It's not as trivial as the error message makes it seem, granted...there's only the named parameter _'Format'_ available as input...

8 years ago | 0

Answered
ploting a 2D matrix and adjusting axes
hAx=gca; % handle to the axes hAx.YDir='normal'; % set Y axis direction--imagesc uses 'reverse' Y See link...

8 years ago | 0

Answered
How to manipulate data between two numbers?
Any number of ways; a couple... z=interp1([min(x) max(x)],[0 1],x); b=polyfit([min(x) max(x)],[0 1],1); z=polyval(x...

8 years ago | 0

| accepted

Answered
Create table from excel spreadsheet with multiple sheets
See doc readtable

8 years ago | 0

Answered
Performing count in column given a condition specified in a different column?
Use more straightforward builtin functions for tables/categorical variables... >> Y=[repmat({'MAY'},8,1);repmat({'DG'},5,1)...

8 years ago | 0

| accepted

Answered
How can I use xlsread with changing indices?
x(j,:)=xlsread('filename',sprintf('A%d:A%d',i,i)); but I'd recommend against using it that way; |xlsread| opens and close...

8 years ago | 0

| accepted

Answered
Replace NaN in table with a corresponding value in a different column
You need the logical addressing vector on both sides and address to return table to update the table... idx=isnan(A.A5); ...

8 years ago | 0

Answered
Matlab for loops output
In |Sig(:,i) = Steer_Vec;| you have the indices reversed relative to the way you sized the array --- *ERRATUM:* Bad eyes... ...

8 years ago | 0

| accepted

Answered
Randomly return of a vector element. How to?
ixFix = N; % set the particular element however is to be done... iRet=[ixFix randperm(numel(A),1)]...

8 years ago | 0

Answered
Make an empty array stay the same size
As Walter says, you allocated an |int16| array but then trashed it by writing a |cellstr| to it; that change in type essentially...

8 years ago | 0

Answered
why the amplitude of fft is not the same as input signal?
See the extensive discussion previously at <https://www.mathworks.com/matlabcentral/answers/405924-hi-please-why-i-don-t-get-the...

8 years ago | 1

Answered
How to take the average of the columns of a matrix and insert into another matrix
fid=fopen('file.txt'); mn=[]; while ~feof(fid) n=fscanf(fid,'%d',1) if isempty(n),break,end d=cell2mat(te...

8 years ago | 0

| accepted

Answered
Need help regarding axis labeling using datetick
>> dt=datetime(1991,1+[0:321].',1); % build a datetime vector to match the dataset >> whos dt ...

8 years ago | 0

| accepted

Answered
Mat lab is only plotting one point for a linspace plot
You're missing the 'dot' in the "./" operator so ML is doing matrix division instead of element-wise...try L=1 - (t*(r.^k)...

8 years ago | 0

Answered
MATLAB Fouriertransform with nunequidistant values
The simplest route is to interpolate to a fixed sample rate and apply the FFT to that series. Alternatively there's a submiss...

8 years ago | 0

Answered
I need to map a binary array to 2 differnet values corresponding to 0 & 1
One of a zillion ways... C=complex(2*ones(size(A)),3*ones(size(A))); C(C==0) = 8-4i; Another less "deadahead" but one...

8 years ago | 0

| accepted

Answered
How to fit multivariate pdf and cdf from data
They're in the _BinCounts_ property of the object or you can just use the old |histcounts2|. *ADDENDUM* Ah, ok. I've not ...

8 years ago | 1

Answered
vgg16 and vgg19 give this error: "Attempt to execute SCRIPT vgg16 as a function:"
You tried to assign a return value to a variable on the LHS of an expression -- scripts don't have return values; they operate i...

8 years ago | 1

Answered
Ignoring markers and lines in legend
... legendInfo{k} = ['Factor = ' num2str(k)]; legend(Plot2,legendInfo) legend(legendInfo) ... If you want only ...

8 years ago | 2

| accepted

Answered
Boxplot help to get 4 plots into 1 graph of 5.
If you plot multiple |boxplot| into the same axis, they'll overlay each other for 1:N variables where N is the composite of numb...

8 years ago | 0

Answered
Use Logical indexing to replace the values in the matrix by its value divided by 2?
ixG7 = A>7; A(ixG7)=A(ixG7)/2; % presuming those are the numbers meant, of course.

8 years ago | 0

| accepted

Answered
How can i shift a curve not just only in plot?
Just add as many zeros to the end of the array as you delete from the front or use y=circshift(h,-N); Probably the more ...

8 years ago | 0

| accepted

Answered
Reading only certain columns from .csv file in matlab
It's far simpler to read the whole file into memory and then just cull the ones not wanted or keep those that are...and probably...

8 years ago | 0

Answered
Looking for an efficient method to repeat the script command for multiple files
folder='C:\Documents\MATLAB\Neuralynx\9Hz\'; % target subdirectory file='CSC*.ncs'); ...

8 years ago | 0

Answered
How to put error bars on top of grouped bars
See my previous at <https://www.mathworks.com/matlabcentral/answers/379570-how-can-i-place-my-error-bar-in-separate-bar-center#a...

8 years ago | 2

Answered
change calculation into financial/fiscal year
Actually, it's pretty simple to accomplish. Given the year and month vectors, create a "financial year" by yrFin=yr; ...

8 years ago | 0

| accepted

Answered
plot a curved line of best fit through my data
<</matlabcentral/answers/uploaded_files/122744/untitled.jpg>> Post the data points, but the red line is clearly _NOT_ the lea...

8 years ago | 0

Answered
How to call a user-defined function
Store it in the working directory or in a directory on MATLABPATH. Depending on what the function purpose is, specialized or mo...

8 years ago | 0

| accepted

Load more