Answered
Trouble with copyfile and rename
copyfile(NameF,[Param.folder1,Param.folder2,'rez.txt']); expands to copyfile(NameF,'C:\Users...C:\Users...rez.txt');...

8 years ago | 0

| accepted

Answered
separate date and time from a .txt file with no spaces
You'll have to read this in pieces to get the first line that has an extra couple of fields, then the subsequent and paste those...

8 years ago | 0

Answered
Index exceeds matrix dimensions error
In Matlab, no loops needed-- data=textscan(fid,'%s%s%d%d','delimiter', '/'); Names=string(data(:,2)); % conve...

8 years ago | 0

| accepted

Answered
Is it possible to remove only specific tick mark(s) while keeping tick labels?
No; removing a tick clears the associated label; there's an inbuilt 1:1 correlation; "no tickee, no lablee". To do this would...

8 years ago | 2

| accepted

Answered
norm inbuilt function code
That's how _all_ builtin functions work in Matlab, that's why they're "built in"; the working part of the function is compiled c...

8 years ago | 0

| accepted

Answered
Updating mean and standard deviation
You can keep the partial sums mu=SUM(x)/N --> SUMX/N SUMX=SUMX+xnew-xold; xold=xnew; in each iteration. Similarly...

8 years ago | 1

| accepted

Answered
On semilogx graph I have two known points and I wish to find out values on a linear line between these two points
Not sure the question, precisely, but consider x = [10 500 10000]; y = [5 15 50]; figure semilogx(x,y,'-'); gri...

8 years ago | 0

| accepted

Answered
how to compare one element in an array with all the other elements in another array? And repeating it for n elements in the first array?
A = [ 1, 2,3,4,5] B = [ 3,4,2,6,8,0] Taking a guess, and what was written literally, >> for i=1:length(A) B...

8 years ago | 0

Answered
how to omit zero values while plotting the graph
A) yplot=y; % make a copy of the data specifically for plotting yplot(yplot==0)=nan; % replace 0 elements ...

8 years ago | 8

Answered
find the index of the mean and mode of a plot
doc find *NB:* there's nothing that says there _will_ be a value in the _Y_ vector that matches the value of the mean; lik...

8 years ago | 0

Answered
What is the function for receiving a vector that will contain the elements of the second diagonal?
Read the input description; there's a second optional argument to |diag|

8 years ago | 1

Answered
How using function Stairs for a market ?
S = [400 500 200]; % supply PS = [15 25 55]; % Price supply [PS,iPS]=sort(PS); % sort price ascendin...

8 years ago | 1

| accepted

Answered
Heatmap labels based on another matrix
See the examples; you didn't call it with anything excepting the data array so it can't "know" anything about labels... <http...

8 years ago | 1

| accepted

Answered
Error calling global variable in function
|global Global_Coeff;| has to be in every workspace and/or function that wants/needs access to the global variable; all you've d...

8 years ago | 1

| accepted

Answered
Separating Data into columns based on certain text variable in that data
>> data=readtable('jack.dat','format','%{MM/dd/yyyy}D %s %f%%') data = Var1 Var2 Var3 __________ ...

8 years ago | 0

| accepted

Answered
Changing the parameters of a for loops if condition is met
... Q=1 % heating of 1kW QMult=[2 5]; % choices from original posting for Y = 1:NOC for x = ...

8 years ago | 0

| accepted

Answered
How can I find the range of empty data in a table
Just use |ismissing| on the original table.

8 years ago | 0

| accepted

Answered
Edit the limits in least squares line.
If you need to do more than what |lsline| does which is to draw the line from the axis limits but not give anything else useful ...

8 years ago | 0

Answered
How to provide 2-Y axis scale in a plot function ?
See doc yyaxis

8 years ago | 0

Answered
How to plot observations against season and time of day?
Somewhat more enhanced...turned into a function with some input parameters to control some features; uses the same input data fi...

8 years ago | 0

Answered
How to plot observations against season and time of day?
Well, here's a (not _quite_ so) crude second pass... <</matlabcentral/answers/uploaded_files/110569/untitled.jpg>> Incorpo...

8 years ago | 0

| accepted

Answered
How to extract data from multiple data files?
In broad strokes, bdr=readtable('boundaryfilename.txt','delimiter','tab'); d=dir('*.txt'); % use appropriate wildcard t...

8 years ago | 0

Answered
Sum for every n number within a single column vector
The inside-information way is just sum(reshape(x,48,[])) making use of internal storage order and that Matlab functions ...

8 years ago | 0

Answered
How could it be that by FFT is not symmetric?
FTrho(2:end-1) = 2*FTrho(2:end-1); You're doubling the DC component, too.

8 years ago | 0

Answered
Combing information from 4 columns to create a new column
Presuming it is in a spreadsheet as shown above, read the file as text; then the empty cells will remain empty instead of being ...

8 years ago | 0

Answered
How to generate 200 random numbers between -1 and 1 (x-axis and y-axis), resulting in plot from x-axis -1 to 1 and y-axis -1 tot 1 filled with 200 blue diamond points?
Two problems-- # x = -1 + randn(200) simply shifts mean of RNV from 0 to -1 leaving range alone about mean # plot (x,'bd') p...

8 years ago | 2

| accepted

Answered
Read multiple .CSV files with csvread using a for loop
d=dir('*_p.clv'); % dir struct of all pertinent .csv files n=length(d); % how many there were data=cell(1,n); ...

8 years ago | 2

| accepted

Answered
How do I calculate a sliding correlation between two time series
Presuming no missing observations and beginning at the minute, 5 min/[5 sec/sample/60 sec/min]--> 60 samples. Given the two sig...

8 years ago | 0

Answered
How to get the probability value (y) for a given (x) from a probability normalised histogram?
If you fit a functional to the distribution, then use |icdf| (inverse cdf) with those parameters; if empirical only then it's a ...

8 years ago | 0

| accepted

Answered
Computing average absolute time from date strings without years
t=readtable('example.csv'); % read the data t.folder=char(t.folder); ...

8 years ago | 0

Load more