Answered
My data type changes to uint8 after if condition I want to keep it int16
A simplification of your code: SubVideoGREEN = zeros(H, W, F, 'int16'); for TrialFrame=1:num_stackimages; Tri...

5 years ago | 0

Answered
I am getting error "not enough input arguments" , I don't know how to resolve this.
How do you call this function? If you use the green triangle in the editor, the function is called without inputs and you will s...

5 years ago | 0

Answered
How do I solve an ODE that is piecewise defined, and oscillates between the two states?
The purpose of the event function is to stop the integration, such that the outer loop can restart it with the modified model. I...

5 years ago | 1

| accepted

Answered
Unable to perform assignment because the left and right sides have a different number of elements.
The error means, that the contents of the fields clmax are not scalar. Check this: clmax = {del.clmax}; s = cellfun('prodo...

5 years ago | 0

Answered
Matrix dimensions must agree.
The error message means, that Actual_Diagnosis_Matrix and Diagnosis_Matrix have different sizes. Then the == operator cannot com...

5 years ago | 1

| accepted

Answered
Arrange the values in a Matrix in a way (line by line)
G = [3 3 9 1 9; ... 3 5 8 1 8; ... 6 3 10 2 6; ... 6 3 ...

5 years ago | 0

Answered
How to execute a function when stored in a variable
This is the job of functions. Hiding the function as char vector in a MAT file is too strange to be clear or efficient. Simple s...

5 years ago | 1

Answered
array counting in not happening
The variable i is not defined. If you omit it, num2str() replies a cell array and numel does not work directly. With cellfun(): ...

5 years ago | 1

Answered
how to open an external text file, identify two strings and save the lines of the text file where the two strings appear
S = fileread('sample_text.txt'); C = strsplit(S, '\n'); Pattern1_line = find(contains(C, 'Pattern1', 'IgnoreCase', true)); Pa...

5 years ago | 1

Answered
Redirecting arithmetic functions from LAPACK/BLAS?
The question is not clear yet. Can you post some input, e.g. produced by RAND(), which reproduce the timings you are observing? ...

5 years ago | 1

| accepted

Answered
I need to loop a code i was given
for k = 1:24 ... your code, but replace "20" by k end

5 years ago | 0

Answered
how to have a changing input in a function
t2 = linspace(0, 10, 100); DV = zeros(size(t2)); for k = 1:numel(t2) DV(k) = deltaV(debris1, debris2, t1, t2(k), t1_0, t2_...

5 years ago | 0

| accepted

Answered
Call .c function in working directory
Please post a copy of the error message, not a rough paraphrasation. "needing a compiler" seems to mean, that you did not insta...

5 years ago | 1

Answered
All blocks in this if statement are identical. (error in running GUI)
Were does this message occur? I do noit understand the purpose of your code also. Your code: for i = app.NormalSkinButton.Val...

5 years ago | 0

Answered
i wanna to plot the eulars formula on matlab with 3d plot
t = linspace(-1, 1, 200); r = cos(2 * pi * t) + 1i * sin(2 * pi * t); figure; plot3(t, real(r), imag(r), 'Color', 'k', 'Lin...

5 years ago | 0

Answered
floating point arithmetics computing in quadruple precision
In Matlab 6.5 you could control the usage of the 80 bit registers: % [UNTESTED in modern Matlab versions] system_dependent('se...

5 years ago | 0

Answered
Find all but one in an array of chars
Do you mean: features.no_genes = find(~strcmp(gff(:, 3), 'gene')); % ^ Do you mean "contains" or that...

5 years ago | 0

Answered
Help with ODE system inside lsqnonlin
It depends on what dw and the other global variables are. Set a break point in this line: output = [pi * dw * x2; ... ...

5 years ago | 0

| accepted

Answered
Creating a column vector in a for loop
options = ['A', 'B']; n = 10000; a = 0; b = 0; countA = zeros(n, 1); countB = zeros(n, 1); for j = 1:n...

5 years ago | 0

| accepted

Answered
Creating a certain array
v = rem(1:10, 2); M = 10 + 10 * (v ~= v.') Or with linear indexing: M = 10 * ones(9); M(2:numel(M)) = 20; The 1st method wo...

5 years ago | 0

| accepted

Answered
How to vectorize a for loop with array multiplication?
Prefer to post the examples such, that they can be started by copy&paste. Nm = 19; Sloctemp = rand(30, 6, 6); Sort ...

5 years ago | 0

| accepted

Answered
transform matrix nx3 to cell nx2
O = [ 0 10 0; ... 0 10 0; ... 0.1 2 3; ... 0.1 2 ...

5 years ago | 1

| accepted

Answered
how to store the output of for loop
for ii = 0:d2:d2*(GW-1) for i = 1:2:2*GL plot(i * center_x, center_y, 'o'); end center_y = center_y + d2; ...

5 years ago | 0

Answered
How to temporarily pause execution of a function for troubleshooting
This is a job for the debugger: if ~isreal(Variable) keyboard end Or: if ~isreal(Variable) disp('problem reached') ...

5 years ago | 0

| accepted

Answered
give matrix element in for loop
Welcome to Matlab. This is the most frequently asked question and a severe mistake of beginners. Do not hide indices in the nam...

5 years ago | 0

Answered
How to quickly find the indecis of an array in another array?
Do you have such tiny inputs in all cases? Then a linear search is faster than the smart sorting of intersect and the binary sea...

5 years ago | 0

| accepted

Answered
function - input and output matrix
Your code is fine. The only problem is, that you call it with a struct. Unfortunately you show us the code, but not, how you cll...

5 years ago | 0

Answered
How do I create and save an audio file from the output of text to speech synthesizer
See: https://www.mathworks.com/matlabcentral/fileexchange/18091-text-to-speech And: NET.addAssembly('System.Speech'); synth ...

5 years ago | 0

| accepted

Submitted


GetFullPath
Full path name for partial or relative path

5 years ago | 3 downloads |

4.8 / 5

Answered
How to find position a input
z(m,n,i,ii) = (x(m)).^4'* sin(y(n)).^3'*cos(xx(i)).^2'*(yy(ii)); % Voodoo: ^ ^^ ^ ^ ^ ^ ^ ^ ...

5 years ago | 1

Load more