Answered
How can I plot two vectors of different lengths ?
A_plot = (A(2:end)+A(1:end-1)) / 2;

10 years ago | 1

| accepted

Answered
how can I generate matrix from each cell array and then separately apply matrix operation on each matrix?
Just like you use with |pop|, you can put those numeric arrays into one cell array (untested as you did not provide us with |Typ...

10 years ago | 1

| accepted

Answered
How to use global variable as local variable
_"How to use global variable as local variable"_ The best answer is "don't". Good code does not use globals: _"I have never s...

10 years ago | 2

| accepted

Answered
install matlab on my pc (personal computer)
This question has been answered may times before, and anyone who has internet access can easily find them using their favorite i...

10 years ago | 0

Answered
How to convert binary stream of length 1*524288 to decimal string of length 1*65536?
<https://www.mathworks.com/help/matlab/ref/bin2dec.html |bin2dec|> probably does most of what you want: >> bin2dec(reshape('...

10 years ago | 1

| accepted

Answered
Reading an Array in scientific notation from a txt
MATLAB's <https://www.mathworks.com/help/matlab/ref/textscan.html |textscan|> reads E-notation numbers perfectly: fid = fope...

10 years ago | 1

| accepted

Answered
Undefined operator '*' for input arguments of type 'cell'. Error in eg9copy (line 23) RBV=((Vc*l1+Vd*((l-l2)/l)))
_"How can I solve this problem"_ If you had read the <https://www.mathworks.com/help/matlab/ref/inputdlg.html |inputdlg|> doc...

10 years ago | 0

| accepted

Answered
array to matrix transformation with size[ length of array , largest element in array]
No need to for any ugly loops, just use <https://www.mathworks.com/help/matlab/ref/sub2ind.html |sub2ind|>: >> C = [1,1,2,3...

10 years ago | 1

| accepted

Answered
section divider or %% is not working
Cell mode can be enabled or disabled from the *Cell* menu. Different versions of MATLAB might put this in different places, b...

10 years ago | 1

| accepted

Answered
xlsread and its output argument in a for loop
Don't do this. Read this to know why: <https://www.mathworks.com/matlabcentral/answers/304528-tutorial-why-variables-should-n...

10 years ago | 1

| accepted

Answered
String ' 1 45789', can I use textscan to get 1, 45, and 789 ?
A simple and robust method: >> str2double(num2cell(reshape(' 98 99 99100101102',3,[])',2)) ans = 98 99 ...

10 years ago | 1

| accepted

Answered
Not enough input arguments
|predictClassRFWithScores| is a <íhttps://www.mathworks.com/help/matlab/learn_matlab/scripts-and-functions.html function, not a ...

10 years ago | 0

Answered
max and min value of matrix
<https://www.mathworks.com/help/images/ref/blockproc.html |blockproc|> might do what you want: >> X = rand(3000,2000); >...

10 years ago | 0

| accepted

Answered
While running this matlab code the value of x(513) is infinite value.But while calculating manually it is a finite value only.
Because your calculation exceeds the largest value that can be represented using the <https://www.mathworks.com/help/matlab/matl...

10 years ago | 0

| accepted

Answered
Gradient function not working
According to the <https://www.mathworks.com/help/matlab/ref/gradient.html |gradient|> documentation: [Tx,Ty,Tz] = gradient(....

10 years ago | 1

| accepted

Answered
calling a function: "undefined function or variable 'abc'"
You are getting confused by the variable names that you have used inside the function. These are irrelevant. It does not matter ...

10 years ago | 0

| accepted

Answered
how to get value from work space
It is highly recommended to use the non-evaluating syntax of <https://de.mathworks.com/help/matlab/ref/input.html |input|>, whic...

10 years ago | 0

Answered
How to convert a fasta file to txt file?
This question is easy to answer because you do not have to do anything: a <https://en.wikipedia.org/wiki/FASTA_format FASTA> fil...

10 years ago | 0

Answered
Checking if inserted text has numbers
Use <https://www.mathworks.com/help/matlab/ref/isstrprop.html |isstrprop|>: >> all(isstrprop('onlyalpha','alpha')) ans =...

10 years ago | 1

Answered
Find value in an NxMxP array and return index
>> val = 9; >> X = reshape(1:36,3,3,4) + rand(3,3,4); >> [C,I] = min(abs(X(:)-val)); >> X(I) ans = 9.3895 Or w...

10 years ago | 0

Answered
How to Upload modified code in File Exchange
Disclaimer: I am not a lawyer, and this answer does not constitute legal advice. You can submit your new version to MATLAB ex...

10 years ago | 1

| accepted

Answered
It is not giving me Results I don't know why?
Because you have an |if| inside another |if|. The problem is obvious if you format your code consistently. For example the de...

10 years ago | 0

| accepted

Answered
Read coordinates on a txt file and plot them over an image.
Images are referenced to the top left of the image (due to traditions related to the scanning of a CRT), so this is how all imag...

10 years ago | 1

Answered
Find max values of n previous values in a matrix without a loop.
The simplest solution is to download Jos's excellent FEX submission |slidefun|, which works for all MATLAB versions (|movmax| wa...

10 years ago | 1

Answered
how to use the split function the below dataset
The simplest solution is to use <https://www.mathworks.com/help/matlab/ref/regexprep.html |regexprep|>, which only requires one ...

10 years ago | 0

Answered
how to find date data type in given field
One way is to use <https://www.mathworks.com/help/matlab/ref/regexp.html |regexp|> to match the date string formats that you wis...

10 years ago | 0

Answered
Problem with gui's data transfer between callbacks
Why are you using |0| for the graphics object handle? You need to use the figure handle, or perhaps axes handle, exactly as t...

10 years ago | 1

Answered
Error in matrix account
The definition of |alpha| makes it a vector with fifty elements: alpha=linspace(0,1.13,50); Then inside that big matrix y...

10 years ago | 0

Answered
??? Input argument "A" is undefined. in the following code of Apriori!
You need to call the function |GetNonTrivialSubsets| with an input argument, like this: >> X = [1,2,1]; >> GetNonTrivialSu...

10 years ago | 1

| accepted

Answered
while running apriori algorithm in MATLAB i get the error message " Reference to non-existent field 'T' ".
Load your data: data=load('datamatrixx'); and then check what fields it has: fieldnames(data) Does it contain a fi...

10 years ago | 1

| accepted

Load more