Answered
Homework Help: What did I do wrong?
The == operator compares its arguments elementwise. If they have a different number of elements, this fails, except it one is a ...

5 years ago | 0

Answered
Error in Y label
In the code you have: kylabel('Value of the function', 'fontize', 10) title('function 1', 'fontzie', 10) The error message sa...

5 years ago | 0

| accepted

Answered
Runge Kutta 4 - Biological Application
I would like some help to understand if I did it right. I cannot estimate what you consider as right or not right. For a real...

5 years ago | 0

Answered
convert logical values to numeric values
a = [1 1 5 1 1] b = ischange(a) c = double(b) % Alternative: d = b + 0 % Addition with DOUBLE converts to double cell2...

5 years ago | 1

| accepted

Answered
Averageing cell arrays in cell array
Using loops is the direct, clean and efficient way to access nested structs. cellfun works on cells only, not on nested structs...

5 years ago | 0

| accepted

Answered
i have number i need save only integer without any point or 'e'
To get an integer value use round, floor or ceil. If you only want to hide the fractional part, which can contain small numbers...

5 years ago | 0

Answered
How to change a char array into char row vectors?
ListA = ['BETA1'; ... 'BETA2']; ListAC = cellstr(ListA); Now you can run REGEXP on the cell string.

5 years ago | 0

| accepted

Answered
FOR LOOP, add value to each row at a time
X = ones(1, 10); for n = 1:size(X, 2) Y = X; % Copy original value Y(n) = Y(n) + 1; ... do what you want to ...

5 years ago | 0

| accepted

Answered
Looping over paths, more than one loop
I do not understand, what your inputs are exactly. But maybe this idea helps you: keepCode = cell(length(vectorOfNames), length...

5 years ago | 0

| accepted

Answered
List the 10% highest values of a distribution
I guess that "x_UDP" is the same as "x". RMSF = load('rmsf.dat'); n = RMSF(:,1); %number of residue x = RMSF(:,2); %RMSF fo...

5 years ago | 1

| accepted

Answered
Matlab code that does integration as well plot
Your code overwrites H in each iteration. So the final PLOT command outside the loop draws 1 point only. Because single points a...

5 years ago | 0

Answered
Error: Index exceeds the number of array elements (1).
You have defined months as a scalar: months(1) = month(dates(1)); Then months(g) must fail, if g>1. I cannot guess, what you ...

5 years ago | 0

| accepted

Answered
Problem with fscanf command in creating .txt file
filename1 = ['*new.txt'];%filename fid_t=fopen(filename1,'r') This cannot work: '*new.txt' is not a valid file nam...

5 years ago | 0

| accepted

Answered
Save multiple image automatically
Your code must fail with an error message in this line: outfile = fullfile(outfolder, sprintf(['%s-coba-%03d.%s',basename,'.jpg...

5 years ago | 0

| accepted

Answered
How to make a +5 (or any +number) jump in array values inside a for loop?
You can use FEX: RunLength , or this part taken from it: function n = RunLength_count(x) d = [true, diff(x(:).') ~= 0, true]; ...

5 years ago | 0

Answered
Can't start Matlab
I guess, that the preferences folder is damaged. Try to recreate it by renaming 'C:\Users\<youraccount>\AppData\Roaming\MathWork...

5 years ago | 1

Answered
Reading a text file containing strings and numeric data
fid = fopen(File, 'r'); if fid < 0, error('Cannot open file'); end TimeLen = 1e6; TimeIndex = 0; Time = zeros(1, Ti...

5 years ago | 0

| accepted

Answered
ode45, Please tell me how to fix this?
Did you save one of your functions as "ode45.m" file? Check this in the command window: which ode45 -all If you find a user-de...

5 years ago | 0

Answered
How do I compute the mean value of odd rows of a random matrix (mxm)? (using if and rem)
I do not have any idea, how "if" can be used to produce a random matrix. But using REM() to get the odd indices is easy: for ...

5 years ago | 0

| accepted

Answered
How to extract specific row from a large csv file and reshape it
Data = csvread(FileName); Row = [1, 100, 200, 300]; figure; for iRow = 1:numel(Row) Block = reshape(Data(iRow, :), 8, 8...

5 years ago | 1

| accepted

Answered
How to append values from different files to an array?
Do not use "mean" as name of a variable, because then you cannot use the function mean() anymore. Folder = 'C:\Your\Folder'; ...

5 years ago | 1

| accepted

Answered
Prime number sum from cell array
The variable myArr is a double array. Then isstrprop(myArr, 'digit') is FALSE for all elements, because onbly CHARs can be digit...

5 years ago | 1

Answered
Completing elements of a matrix
a = [2; 3]; b = [1.5; 2]; c = kron(a, [ones(size(a,1), 1), b])

5 years ago | 0

Answered
How to compare two strings with different sizes?
A bold guess: a = 'AAGCTACGC' b = 'ACGCAA' Nmin = min(numel(a), numel(b)); Nmax = max(numel(a), numel(b)); match = fals...

5 years ago | 0

Answered
matrix product different sizes
The multiplication of a 36-by-36 and a 36-by-10 matrix is mathematically defined and creates a 36-by-10 matrix. But you cannot m...

5 years ago | 0

| accepted

Answered
using a function with matrices
"function [rating] = rating(x,y)" does not match the information, that the function has 3 inputs. "gives the error message that...

5 years ago | 0

Answered
Figure not showing up when attempting to plot array
It takes only a second on my system (Win10 Matlab 2018b). So either there is an open but hidden window or another problem. Chec...

5 years ago | 0

Answered
Matlab does not plot data which are mirrored data
If the 2nd half of the data equals the 1st half in different order, you do plot all data, but the line overlap. See: r = [1 0...

5 years ago | 1

Answered
Is there a way to get an 8 x 1 matrix instead of 8 x 3 using dec2bin or any other?
If you want 000 as output, remember, that this is not a valid decimal value. If you need the zeros for any reason, you have to s...

5 years ago | 1

Answered
How can I set the default text size on figures in matlab 2018?
The default of an axes works exactly as you have defined it: figure; axes; set(gca, 'DefaultTextFontSize', 35) text(0.5, 0.5,...

5 years ago | 1

Load more