Answered
How to change values in a vector
One idea is to store them as datetime and then extract just seonds field, for example dt = datetime('11:06:20'); secOnly...

8 years ago | 0

| accepted

Answered
I need a detailed explanation about this code
I suppose you read the documentation to understand what each command does and how a loop works. As far as this code is concerned...

8 years ago | 0

| accepted

Answered
How to read .log file and extract required data ?
if the file has table like structure just use, data = readtable('yourfilename.log') if you don't want the output as tab...

8 years ago | 1

Answered
Looping to create multiple variables?
Don't create such variables, read here to know why <https://www.mathworks.com/matlabcentral/answers/57445-faq-how-can-i-creat...

8 years ago | 0

| accepted

Answered
Hi, all! I have a array of monthly log returns from 1962 to 2016, I wish to extract the monthly values, every 12th value.
data = 1:144; %sample data data_mean = arrayfun(@(a,b) mean(data(a:b)),1:12:numel(data),12:12:numel(data))

8 years ago | 0

| accepted

Answered
How to fire the run button automatically for an .m file after a interval of time?
How about using a timer? <https://www.mathworks.com/help/matlab/matlab_prog/timer-callback-functions.html>

8 years ago | 1

Answered
How to average monthly ascii data using Matlab?
If you're using 2016b or later, I'd suggest using <https://www.mathworks.com/help/matlab/ref/timetable.html timetables>. They ma...

8 years ago | 0

Answered
How to remove the line from editor window ???
Preferences->Editor/Debugger->Display-> then uncheck the "show line" option in right hand text limit

8 years ago | 12

Answered
bars at specific (x,y) points
You need to store the temperature values in a 2D matrix considering x, y values as row and column indices. For example, dat...

8 years ago | 1

| accepted

Answered
how to change this error
if you're using it inside another function, you have to pass it as an argument. function output = yourFunction(bla, bla, ...

8 years ago | 0

Answered
how to combine two matrices in a specific order
result = [matrix_1' matrix_2];

8 years ago | 0

Answered
Using experimental database in Matlab for interpolation
Use GRABIT maybe. <https://www.mathworks.com/matlabcentral/fileexchange/7173-grabit> But you'll have to pick the data poin...

8 years ago | 0

| accepted

Answered
How to assign vales to matrix
You have define |i| and |j| in the |for| loop for the entire range. For example, for i=1:5 %%... end

8 years ago | 0

| accepted

Answered
Split legend after blank space
leg_str = {'123456789_1' 'ABCDEFGHIJ_1' '123ABC_1'}; leg_str{4,1} = ['Avg.' char(10) '(' leg_str{1,1} char(10...

8 years ago | 0

Answered
How to define several variables from vector at the same time
You can use cell arrays and get the comma separated lists, xy = num2cell([x y]) [a b] = xy{1,[3 6]}; [c d e] = xy{1, ...

8 years ago | 2

Answered
Problem on printing value of plot
You're creating vectors and so when you use them (t,y) in fprintf, you get multiple values.

8 years ago | 0

| accepted

Answered
Writing if function to Plot graph?
You have tried something but you have got very few things wrong. Firstly when they say y(x)={2 if x<6 , (x-4) if 6=...

8 years ago | 0

Answered
How to count if loops
If I understand you correctly, the second while loop should be above and as Christoph says it should also be initialized before....

8 years ago | 1

Answered
how to sum all elements of one vector?
D = sum(C); div = C./D; %./ meaning element-wise division <https://www.mathworks.com/help/matlab/examples/basic-matri...

8 years ago | 1

Answered
reshaping cell containing double arrays
test = cell2mat(test'); this?

8 years ago | 0

Answered
How to output all these row vectors into a matrix?
You just need to store your |x| values inside the loop in an array. Anyway, firstly when you write v(1)=2; v(2)=0; v(3)=1; ...

8 years ago | 2

| accepted

Answered
how to vectrorized this code?
nump = cell2mat(arrayfun(@(x) x:x:x*10,1:10,'uni',0))'; denp = [ones(100,1) repmat((1:10)',10,1), zeros(100,1)];

8 years ago | 1

Answered
How to simplify this code without having multilevel indexing error???
s2c = struct2cell(matData); c2c = cellfun(@(x) x',reshape(s2c,[],1,1),'uni',0); c2a = cell2mat(cellfun(@cell2mat,c2c,'un...

8 years ago | 1

Answered
Finding the Y value corresponding to X value in a parametric plot
If all your curves have the same timestep and same number of measurements why not put them all together in a matrix and then fin...

8 years ago | 1

| accepted

Answered
Remove duplicate values in matrix
unique(a) %EDITED

8 years ago | 0

| accepted

Answered
For loop only returning first and last iterations correctly
Why do you create |is_corr|. You could directly assign values in |corr_RESP|. corr_RESP = zeros(size(variables,1),1); %prea...

8 years ago | 0

| accepted

Answered
How to add information in a figure already created
If this plot is the current figure then use |gca|, |gcf|. Even better is to output the axes and figure handle from your |plotSom...

8 years ago | 0

Answered
Subtraction of a constant from a matrix column
It works for me >> ver = [1 2 3 ; 4 5 6] X = 3 ver = 1 2 3 4 5 6 X...

8 years ago | 0

Load more