Answered
For loops in simulink
Why not <https://www.mathworks.com/help/matlab/ref/timeseries-class.html create a timeseries object> ? data = rand(35,1); ...

8 years ago | 0

Answered
Attempted to access x(2); index out of bounds because numel(x)=1.
change z0=x(n)-a1*z1-a2*z2; to z0=x-a1*z1-a2*z2; *Attempted to access x(2)* means you're trying to access the 2...

8 years ago | 0

| accepted

Answered
How can i plot (annual plots) data according to the years (which are listed in the first column)?
plot(your_table{your_table.year==2007,{'value'}}) something like that should work, I have't tested it. Let me know if it wo...

8 years ago | 0

Answered
Merging data from different matrices with different row numbers by matching date
If you have R2016b or later, |timetable| does this with |synchronize| command, timetable_summary = synchronize(timetable_co...

8 years ago | 0

Answered
How can I copy a folder into another folder?
copyfile 'folder_path/folder_1' 'folder_path/folder_2' or copyfile('folder_path/folder_1','folder_path/folder_2') T...

8 years ago | 0

Answered
How to select eaach element from a matrix multiplication with bus selector
Use a |Bus Selector| or a |Demux|. <https://www.mathworks.com/help/simulink/slref/busselector.html> <https://www.mathworks...

8 years ago | 0

| accepted

Answered
Convert table entries to vectors?
You should probably use |table2array|. <https://www.mathworks.com/help/matlab/ref/table2array.html>

8 years ago | 6

| accepted

Answered
How can I create a loop for a constant value in a numerical integration problem and plot all solutions on the same graph?
f = @(theta) (1/pi)*cos(z*sin(theta)-5*(theta)); %your other variables z_vec = 0:25; for k=1:length(z) z=z_vec...

8 years ago | 0

| accepted

Answered
how to set the evenly spaced yaxis
try yticks([-90:10:-10])

8 years ago | 0

Answered
Find in cell array
ind = cellfun(@find,cellfun(@(c) strcmp(all_channels,c),bad_channels,'uni',0))

8 years ago | 0

| accepted

Answered
how to update a data in the simulink matlabfcn
You need a feedback of |y|, y = fcn(u1,u2,y_old) %your code ... u = u1.*u2; y = y_old - u*0.5; end and o...

8 years ago | 0

| accepted

Answered
Need help shrinking axis'
ylim([0.4 2]) xlim([0 25]) Please read the documentation! <https://www.mathworks.com/help/matlab/getting-started-with...

8 years ago | 0

Answered
Vectors must be the same length Help
Your |width| variable has one more element than your |d|. Try plot(width(2:end),d)

8 years ago | 0

Answered
How to store image file path , i have 50images in folder , i have to store file name with path as single variable can any one tell me?
folderInfo = dir('your_folder') and then filenames = {folderInfo.name}; filepaths = {folderInfo.folder};

8 years ago | 0

Answered
How to integrate a plot?
trapz(X,Y) <http://www.mathworks.com/help/matlab/ref/trapz.html>

8 years ago | 7

Answered
How to underline the following text in sprintf
I usually go with disp(X) disp('------------')

8 years ago | 0

| accepted

Answered
Using end as a variable to access parts of array
Why do you want to do this? why not just use the length(a), a(5:length(a))

8 years ago | 0

Answered
How to store Data to a text file creating two columns from two different Variables (Matrices)
use <https://www.mathworks.com/help/matlab/ref/dlmwrite.html dlmwrite> , your_variable = [time_vector result_vector]; dl...

8 years ago | 0

Answered
How can I put data under a bar graph?
data = [5 4.7 5.02]; year = [2015,2016,2017]; c = categorical({'2015','2016','2017'}); bar(data); ylabel('Prod') ...

8 years ago | 0

| accepted

Answered
Hi, I have a 150*54 matrix and a table of 18 labels ,and i want to named each 3 column of my matrix(which is 54) by 1 label
your_matrix = rand(150,54); C = mat2cell(your_matrix,150,repmat(3,1,18)); % your_labels = 1x18 cellarray T = cell2tab...

8 years ago | 0

Answered
dectobin ,only with loops and condition
So to convert string to number, doc str2num and then to assign your number in a cell array your_cell_array = {your_...

8 years ago | 0

Answered
Index exceeds matrix dimensions
If your data is a 36x20 array, then |a,b| and then |c| will all be 36x20. But your |i| and |j| are from 1 to 1599/2399. That's w...

8 years ago | 1

| accepted

Answered
plot and axis function
Take this simple example, t = 1:10; y = 10*t; Now use just |plot(y)| in two ways to see the difference. figure(1...

8 years ago | 0

Answered
How to find the closest data row index
*EDITED* for 2D matrix, A = abs(M-V); ind = arrayfun(@(k) find(A(:,k)==min(A(:,k)),1,'last'),1:length(V))

8 years ago | 0

Answered
import a text file into a variable
data = readtable('Uz.txt'); or for just one column, data = textread('Uz.txt')

8 years ago | 0

Answered
Attempted to access A(1,6); index out of bounds because size(A)=[1,2]. error in my program Who can help me please
Your |A| has only 2 elements. |100| and |6|. That's why your |size(A)| returns |[1,2]|. A(100*i*(j-1)+k,6); In the abov...

8 years ago | 0

Answered
Importing large excel with different data types
Try using |readtable|. <https://www.mathworks.com/help/matlab/ref/readtable.html>

8 years ago | 0

Answered
How can I solve this error''Dimensions of matrices being concatenated are not consistent.''?
Look at this example. A has 3 elements, >> A = [1 2 3] A = 1 2 3 B has 2 elements, >> ...

8 years ago | 1

| accepted

Load more