Risposto
Analysing hourly data over a year
Yes, there is. To play with such time based measurements, especially for data over such long duration, you could use a time tabl...

quasi 9 anni fa | 1

| accettato

Risposto
Selecting a value that is repeating most of the times in an array
Another idea using |mode|, <https://www.mathworks.com/help/matlab/ref/mode.html> A = [8 8 8 10 10 13 13 13 5 5 1 7 3 3 8...

quasi 9 anni fa | 1

Risposto
How to shift elements in a row matrix?
If you have access to Fixed-Point Designer toolbox, you could use |bitsll| <https://www.mathworks.com/help/fixedpoint/ref/bit...

quasi 9 anni fa | 0

| accettato

Risposto
How can put the values inside tolerances?
Firstly, you don't need those digdata, digdata2 functions. You're code is very slow because of them. You're loding the same mat ...

quasi 9 anni fa | 1

| accettato

Risposto
why do i get this error "Undefined function or variable 'vect2mat'."?
you mean vec2mat? Note that you'd need communication systems toolbox for that. But otherwise you could use reshape! <ht...

quasi 9 anni fa | 0

| accettato

Risposto
how to reshape data with leap year?
No need to reshape. Use timetables. <https://de.mathworks.com/help/matlab/matlab_prog/create-timetables.html> <https://de....

quasi 9 anni fa | 0

| accettato

Risposto
How I generate a random number between 300 and 450?
randi([300 450]) and everything you need is summarized here: <https://www.mathworks.com/help/matlab/random-number-generation...

quasi 9 anni fa | 1

Risposto
How to remove rows that meet a condition?
allOptions(allOptions(:,1)>=allOptions(:,2),:)=[];

quasi 9 anni fa | 0

| accettato

Risposto
how to select m-file from gui Pop-Up Menu
something like, function pushbutton_callback(src,event) [FileName,PathName] = uigetfile('*.m','Select the MATLAB code...

quasi 9 anni fa | 1

Risposto
How do I separate month, day of the week, and hour of the day for each row of a csv time series file so that I can do a factor analysis for month, day, hour?
Use a timetable! <https://www.mathworks.com/help/matlab/timetables.html> <https://www.mathworks.com/help/matlab/matlab_pro...

quasi 9 anni fa | 0

| accettato

Risposto
Find a specific number in an imported excel sheet
[rowind,colind] = find(B(:,1)==9 & B(:,2:end)==14.38) Do you mean this?

quasi 9 anni fa | 0

| accettato

Risposto
index exceeds matrix dimension
When d = 2, V(SNEXT((d+1)+1,t+1)) means V(SNEXT(4,t+1)) %there's no 4th row and I don't even have to say about 't'...

quasi 9 anni fa | 0

Risposto
zeros before a string using num2str
Try this A = [69.45 31.71 95.36 3.44 7.82]' str = string(A) newStr = pad(str,7,'left','0') %or pad(str,7,'both','0') ...

quasi 9 anni fa | 0

Risposto
Problem with while loop
In the code you've provided, the variables ( |rcapa, capaPA|) are not defined. Moreover even if you define it in the beginnin...

quasi 9 anni fa | 0

| accettato

Risposto
Date conversion, works for one set but not the other, why?
I've tried your codes with the sample data provided, it works just fine. In fact, just the first code snippet works fine for bot...

quasi 9 anni fa | 0

Risposto
how to write text files in a specific format?
You shouldn't need a loop. fileID = fopen('G:\FLOW_OUT_32.txt','w'); fprintf(fileID,'%d %12.6e\n',output32.'); %assuming o...

quasi 9 anni fa | 0

Risposto
Position of an element in a vector
[row,col,v] = find(z==-2)

quasi 9 anni fa | 0

Risposto
i want to extract valid possibilities from matrix. A screenshot of that matrix is attached here.
Try this, Z_re = arrayfun(@(a) [Z(:,a:a+1)],1:2:size(Z,2),'uni',0); Z_selected = cell2mat(Z_re(cellfun(@(x) x(1,1)~=x(2,1)...

quasi 9 anni fa | 0

Risposto
Percentage change and plot
You may want to store the output in a matrix though, for n=1:size(cbf,2)-1 percentage(:,n)= ((cbf(:,n+1) - (cbf(:,1))) ....

quasi 9 anni fa | 0

Risposto
Determine identical value of a column
You could use <https://de.mathworks.com/help/matlab/ref/findgroups.html findgroups> and <https://www.mathworks.com/help/matlab/r...

quasi 9 anni fa | 0

| accettato

Risposto
Removing values so two vectors are the same length
Why don't you put those two vectors (time and data) in table (or even better in a timetable, if you're using 2016 or later) befo...

quasi 9 anni fa | 0

Risposto
Having trouble creating a conditional function
Just use x = -1:0.1:1; f = x.^2.*sin(pi.*x); and then to create g based on f g = f; g(g<0)=0;

quasi 9 anni fa | 0

Risposto
absolute value of negative real numbers
Probably you've created a variable called abs in the workspace. Try clear abs abs(-1)

quasi 9 anni fa | 2

| accettato

Risposto
area between two overlapping plots
You could use |trapz| to calculate the area under the curve. <https://www.mathworks.com/help/matlab/ref/trapz.html> But be...

quasi 9 anni fa | 0

| accettato

Risposto
how to calculate final minimum in for -loop?
I suppose this is a homework and you're not allowed to use in-built functions like <https://www.mathworks.com/help/matlab/ref/mi...

quasi 9 anni fa | 0

Risposto
Display name associated with max number in a while loop.
Import your data as table using readtable, it is so much easier. There's a perfect example for you. T = readtable(fullfile(...

quasi 9 anni fa | 0

Risposto
Concatenating horizontally two cell arrays
If you want to retain the zeros in the beginning why not store them as char? A{1,1}='00016510'; B{1,1}='0'; C=horzcat...

quasi 9 anni fa | 0

Risposto
Cancer dataset file with selected feature with 495 row and 8 column 495x11
Something like this, data = csvread('k1000Refine8.csv'); %import data data_sorted = sort(data,2); %sort them along colum...

quasi 9 anni fa | 1

| accettato

Risposto
How do you allow a user to input a .csv file?
If you want to import data from this file, data = csvread('yourfilename.csv') if you want user to pick the file using a ...

quasi 9 anni fa | 0

Carica altro