Answered
How to call a function
Make these changes: clear,clc,close all % <-------- DELETE THIS AWFUL ANTIPATTERN LINE OF EVIL function [C1, C2, C3, C4, C5, s...

6 years ago | 0

| accepted

Answered
Passing extra output arguments from ode
"In summary my question is, how do I obtain f for the same time instants at which x is obtained." Using a persistent variable o...

6 years ago | 1

| accepted

Answered
why matlab always show my equation as matrix dimension
Most likely you need to follow the advice given in the error message and use array operations, e.g.: y = (668.061./x).*(-39-exp...

6 years ago | 0

Answered
readcell command doesn't work anymore!
This only reads one cell: "Range",'B3:B3' There is nothing in your code that reads "all non empty cells in col B starting from...

6 years ago | 0

| accepted

Answered
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.
function Weight= SGD_method(...) alpha=0.9; N=4; end % <--------- DELETE THIS LINE! for k=1:N ...

6 years ago | 0

Answered
Dynamic regular expression replacement: token number
It can be done with one dynamic replacement expression: >> str = '(1st MT)_fjezhfjksdhf_(2nd MT)'; >> rgx = 'MT'; >> out = re...

6 years ago | 0

Answered
how to do the matrix computation
>> M = c(1,2:end).' + c(2:end,1).' - c(2:end,2:end); % requires MATLAB >= R2016b >> M = triu(M,1) + triu(M,1).' M = 0 1...

6 years ago | 1

| accepted

Answered
Define a series of matrices
Using numbered variables is not going to be neat or efficient. The MATLAB approach would be to use one array, e.g.: sigma = -5:...

6 years ago | 0

| accepted

Answered
How to interpolate column and row?
Use interp2, e.g.: >> Y = [1.0101,1.25,2,5,10,25,50,100]; >> G = [3,2.8,2.6,2.4,2.2,2,1.8,1.6,1.4,1.2,1,0.8,0.6,0.4,0.2,0,-0.2...

6 years ago | 1

| accepted

Answered
'run' command with input argument - MATLAB 2018a
run does not work with functions, it only works with scripts: https://www.mathworks.com/help/matlab/matlab_prog/scripts-and-fun...

6 years ago | 0

| accepted

Answered
I have 16 GB of RAM, why can't I load a 3.5 GB file?
This line has very inefficient use of memory, and is likely the cause of the error: video=uint16(zeros(zeilen,spalten,frames));...

6 years ago | 2

| accepted

Answered
Moving large matrix from function workspace to base workspace?
The correct function to use is assignin, not evalin: assignin('base','data',data) Probably even better would be to just use th...

6 years ago | 3

| accepted

Answered
Constructing a circular type of matrix
For MATLAB versions >=R2016b: >> M = max((1:4).',1:5) M = 1 2 3 4 5 2 2 3 4 5 3 3 3 4 5 ...

6 years ago | 0

| accepted

Answered
find missing element between two matrix
>> A = [1,2;3,6;3,5;1,4;4,6;2,7;1,6;6,5;2,3;6,7;3,4]; >> B = [1,2;1,6;2,3;3,4;4,6]; >> R = setdiff(A,B,'rows') R = 1 4 ...

6 years ago | 0

| accepted

Answered
New line after fprintf
Add a newline at the end of the fprintf format string: fprintf('....\n',D) % ^^ newline!

6 years ago | 1

| accepted

Answered
fprintf cell array of two classes
No need for complex strings, ugly loops, or slow arrayfun, you just need one simple fprintf call:: >> A = ['USA' ; 'CAN' ; 'FRA...

6 years ago | 2

Answered
store workspace file in variables using a for loop
Your approach is entirely the wrong way around. Putting meta-data (e.g. pseudo-indices, subject IDs, parameter values, etc.) int...

6 years ago | 0

| accepted

Answered
How to get common sub string in cell array string?
1- Download and unzip John D'Errico's FEX submission https://www.mathworks.com/matlabcentral/fileexchange/27460-string-subseque...

6 years ago | 1

| accepted

Answered
# 1:end
"explain please" Explanation "why this fill whole matrix" g(r(1:end),c(1:end))=1 The MATLAB documentation explains "There is...

6 years ago | 0

Answered
I have a 2 by 26 matrix, how do i randomly select one of the rows and extract them?
idr = randi(26,1,1); row = shiptext(idr,:)

6 years ago | 0

| accepted

Answered
Periodically save matrixes (or workspace) within PARFOR loop
https://www.mathworks.com/matlabcentral/answers/135285-how-do-i-use-save-with-a-parfor-loop-using-parallel-computing-toolbox No...

6 years ago | 1

Answered
Why doesn't cd command work on parametric directory names ?
"How can I resolve it ?" Use function syntax (not command syntax): cd(sub) https://www.mathworks.com/help/matlab/matlab_prog/...

6 years ago | 1

| accepted

Answered
Stop the Inf numbers
You used the wrong operator: mrdivide / solves a system of linear equations. You need to learn the differrences between matrix ...

6 years ago | 1

Answered
Problem with regexp Japanese
The \u syntax is not valid in MATLAB: \u3000 % !!! NOT CORRECT !!! To create a character from hexadecimal use \x: \x3000 Sou...

6 years ago | 1

| accepted

Answered
How to find the position of the first non-zero element of my matrix?
find(yourVector,1,'first')

6 years ago | 5

| accepted

Answered
Sorting alphanumeric data and then grouping by number - is this possible?
>> C = {'MyCulture/Cell316';'MyCulture/Cell0';'MyCulture/Cell339';'MyCulture/Cell0';'MyCulture/Nucleus50';'MyCulture/Nucleus0';'...

6 years ago | 0

| accepted

Answered
Difficulties with interpreting and use of @ sign
There is nothing stopping you from having an unused input argument: f = @(t,y)((y-1)*(y-2)) % ^ perfectly okay to define t...

6 years ago | 2

| accepted

Answered
How to process files of a particular order in MATLAB?
"Possibly what is the error, it says that File doesn't exist." Most likely the files do not exist in the location where you are...

6 years ago | 0

| accepted

Answered
How to restrict input string in length,symbols, char and numbers
>> str = 'XYZ-99-123'; % okay >> ~isempty(regexp(str,'^[A-Z]{3}-\d{2}-\d{3}$','once')) ans = 1 >> str = 'XYZ-99-ABC'; % not o...

6 years ago | 0

| accepted

Answered
Convert a cell array into matrix, but with removing the words / commas
In both cases it looks like you are processing data imported from a file, in which case it would be much more efficient to fix t...

6 years ago | 0

| accepted

Load more