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

8 years ago | 1

| accepted

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

8 years ago | 1

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

8 years ago | 0

| accepted

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

8 years ago | 1

| accepted

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

8 years ago | 0

| accepted

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

8 years ago | 0

| accepted

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

8 years ago | 1

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

8 years ago | 0

| accepted

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

8 years ago | 1

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

8 years ago | 0

| accepted

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

8 years ago | 0

| accepted

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

8 years ago | 0

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

8 years ago | 0

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

8 years ago | 0

| accepted

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

8 years ago | 0

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

8 years ago | 0

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

8 years ago | 0

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

8 years ago | 0

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

8 years ago | 0

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

8 years ago | 0

| accepted

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

8 years ago | 0

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

8 years ago | 0

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

8 years ago | 2

| accepted

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

8 years ago | 0

| accepted

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

8 years ago | 0

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

8 years ago | 0

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

8 years ago | 0

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

8 years ago | 1

| accepted

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

8 years ago | 0

Load more