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

más de 8 años hace | 1

| aceptada

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

más de 8 años hace | 1

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 1

| aceptada

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 1

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 1

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 2

| aceptada

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 1

| aceptada

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

más de 8 años hace | 0

Cargar más