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

más de 8 años hace | 0

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

más de 8 años hace | 2

| aceptada

Respondida
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); ...

más de 8 años hace | 2

| aceptada

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

más de 8 años hace | 0

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

Respondida
Ploting data from .txt file
|timeseries| doesn't plot anything; all it does is create a timeseries object. Per the documentation, the data for the _time ve...

más de 8 años hace | 0

| aceptada

Respondida
When I first learned programming ...
First was a two-week stint in an intro NE course (also w/ McCracken, of course) in which were taught rudiments of syntax and all...

más de 8 años hace | 1

Respondida
Averaging data sets with certain criteria (month and year)
See <https://www.mathworks.com/help/matlab/ref/splitapply.html <splitapply>> For your specific case and data as coded, if you l...

más de 8 años hace | 0

| aceptada

Respondida
More than 16 barplots in one figure?
By default there aren't tick marks every integer value; they typically make things too crowded. xlim([0 17]) ylim([0 10]...

más de 8 años hace | 0

| aceptada

Respondida
Is it possible to add a new Marker Specifiers?
Again one of the great mysteries of what TMW sees as useful enhancements versus what they actually implement... :( There is, ...

más de 8 años hace | 0

Respondida
Two for loops running simultaneously
b = get(handles.edit1, 'String') N=int(str2num(b)*60); temp=zeros(N,1); for d=1:N temp(d)= readVoltage(a,'A15');...

más de 8 años hace | 0

Respondida
creating a vector from data in a large array
Start with the "brute force, straightahead" solution... dN=65; % the magic number between observations-...

más de 8 años hace | 0

Respondida
Fill area smaller than treshold1 and greater than threshold2
|area| is in essence a stacked horizontal bar plot; not a filling routine. Use |fill| instead-- hF(1)=fill(t,max(yi,th1), ...

más de 8 años hace | 0

| aceptada

Respondida
How do you import a .log file and put the information into various columns with headers?
>> [~,t]=xlsread('shem.csv'); % about the most easiest way to read csv with mixed data >> t=t(2:end,:).'; % ge...

más de 8 años hace | 1

| aceptada

Respondida
Number to datetime from textdata
If I put your exact text in a file then >> fmt='%{%yyyyMMddHHmmssSSS}D' fmt = %{%yyyyMMddHHmmssSSS}D >> fid=fope...

más de 8 años hace | 0

| aceptada

Respondida
how to save every iteration into workspace
n=length(filesStruct1); % presuming filesStruct1 is returned from DIR() alpha=cell(n,1); % listen to the...

más de 8 años hace | 1

Respondida
How to remove missing/non existing days in a graph?
This ? appears closely related to <https://www.mathworks.com/matlabcentral/answers/385639-plot-financial-data-continuously-in-ti...

más de 8 años hace | 0

Respondida
Need to access only few samples from and an array
_"...I do not wanted [sic] index position 9,10,11,12 to be processed."_ If you mean original indices then just remove them fr...

más de 8 años hace | 0

| aceptada

Respondida
I want my code to read from a csv file, the csv file (dee1) has 2 columns which the first one is Time_stamps and second one is load value . but the output of the function only read time_stamps. what should I do to fix it ?
The format string doesn't match the record; particularly the datetime format... >> fmt = '%{M/d/yyyy HH:mm}D %f'; >> dat...

más de 8 años hace | 0

Respondida
How to filter rows with respect to specific entry?
>> A=[1 2 3 4 5;0 1 2 3 4;5 6 3 2 1]; >> A(A(:,3)==3,:) ans = 1 2 3 4 5 5 6 3 ...

más de 8 años hace | 1

| aceptada

Respondida
Can a format string be supplied to detectImportOptions?
Use |setvaropts| to control properties associated with particular variables; specifically the |DatetimeVariableImportOptions| p...

más de 8 años hace | 0

| aceptada

Respondida
How to effectively run loops and save time in computation? I have a matrix of size 'm' and run five loops from 1 to m.. How to optimize the code and save time of calculation for the code below
Innermost loop for j=1:m if j~=i x(j)=abs(Ohmega(i,k)+Ohmega(j,k)); end has "issues" -- first...

casi 9 años hace | 1

| aceptada

Respondida
Axis limits when one bound is set to inf
Have to allow as how I've never set an axis limit to +/-Inf...not having that large of a monitor. :) I didn't go look and see...

casi 9 años hace | 0

Respondida
how to get the second variable in a function?
[A,B] = par(20,5); The function has to have somewhere to "put" the other output...

casi 9 años hace | 0

Respondida
Undefined operator '>' for input arguments of type 'cell'. Error in sif (line 374) if (hist(i,1)> a)
Apparently _rt_ is a cell array containing a cell. Hence need to "use the curlies, Luke!" to dereference the content. Try ...

casi 9 años hace | 0

Respondida
How to open text files with different names?
Presuming you have a plate number variable _platenum_ fname=sprintf('%dplate.txt',platenum); load fname Unless this d...

casi 9 años hace | 0

Respondida
How to import specific part of text file when you do not known the size and which lines is the one you want to import
OK, here's a basic function to read any section of the file returning the data in that section plus optionally the X,Y coordinat...

casi 9 años hace | 0

| aceptada

Respondida
How do I extract elements of an array having their indexes in another array?
Instead of looping, just use Matlab logical indexing...your solution should look like idx=[]; %get the index of all values ...

casi 9 años hace | 1

| aceptada

Respondida
How to control Minortick number
See the numeric ruler for some additional control over axis appearance not made visible by the _axes_ object... <https://www.mat...

casi 9 años hace | 0

Cargar más