Answered
The assignment cannot be performed because the size of the left side is 1×1 and the size of the right side is 0×0.
"But I do not know where is wrong" The problem is caused by using GLOBAL variables instead of parameterizing the function prope...

4 years ago | 0

| accepted

Answered
how do I know which toolboxes are installed?
"...an easy way to see which toolboxes are already installed into a windows workstation" " We would like to get this informatio...

4 years ago | 0

| accepted

Answered
Getting an error For colon operator with char operands, first and last operands must be char.
This line j=('Input number of crossings =') should be j = input('number of crossings =')

4 years ago | 0

Answered
Not enough input arguements in a function
The Events function is defined to have only two input arguments (not three like COND): https://www.mathworks.com/help/matlab/re...

4 years ago | 0

Answered
Matlab does not calculate
Just change the FORMAT, e.g.: format short G T = 0:5:100; V = (1.458.*10.^-6).*((T+273.15).^0.5)./(1+(110.4./(T+273.15))); [...

4 years ago | 0

Answered
Unrecognized function or variable
Unrecognized function or variable 'lenght'. % ^^ spelling mistake

4 years ago | 1

| accepted

Answered
Assign double array to cell array
n = 78; v = rand(n,1) % double array Either: x = num2cell(v) or: x = cell(n,1); x(:) = num2cell(v) Storing numeric scalar...

4 years ago | 0

| accepted

Answered
How to extract vectors from strings
>> A = 'REAL 1.001 2.801 4.378 6.283 7.941 10.774 12.436 14.760 16.205 17.577 1...

4 years ago | 0

| accepted

Answered
how to take every row in matrix?
You could use MAT2CELL, just generate the sizes based on your matrix dimensions and requirements: A = randi(10,10,10) C = mat2...

4 years ago | 0

| accepted

Answered
How to recursively reduce the function arguments
It can be done with VARARGIN: N = 5; C = cell(1,N); C{N} = @f5; for k = N-1:-1:1 C{k} = @(varargin) C{k+1}(varargin{:},...

4 years ago | 1

| accepted

Answered
Adding extension to fille
Simpler: P = 'Data'; S = dir(fullfile(P,'**','*')); S = S(~[S.isdir]); for k = 1:numel(S) F = fullfile(S(k).folder,S(k)...

4 years ago | 0

| accepted

Answered
Find index in struct field in which word appears
"How do I find the row in which this appears in the attached struct in which the subjects are listed in the field 'Subject'?" Y...

4 years ago | 0

Answered
How to convert Data from 'yyyyMMddhhmm' format to datetime format
"... HS_date is a matrix of 1x52561 double values, the data is from 202201010000 to 202301010000." Abuse of decimal numbers to ...

4 years ago | 0

| accepted

Answered
Removing files that match a pattern from files that are on local PC
Assuming that no filenames are substrings of other filenames (e.g. all have the same number of characters): P = 'C:\Users\jorri...

4 years ago | 0

| accepted

Answered
Could anyone please help me to solve the issue in the following command line.
M = reshape(randperm(10),5,2)

4 years ago | 0

| accepted

Answered
How to duplicate rows of a matrix if the number of copies for each row are different?
out = repelem(A,b,1)

4 years ago | 0

| accepted

Answered
What is the use of "maxidx = max(A(:))+1" in the below code ? How does it work? Any alternate syntax for the below function?
"Can someone explain the use of "maxidx = max(A(:))+1;" in this code" The answer can be derived from https://www.mathworks.com/...

4 years ago | 0

| accepted

Answered
Keeping track of order of rows when sorting a matrix
"Or other than this is there any better method? " The MATLAB approach is to get the second output from SORTROWS, which is the s...

4 years ago | 1

| accepted

Answered
How can I get multiple values from arrayfun?
"However, I want to get 21000 double instead of 11000 cells. Is there any way I can get x1 as 2*1000?" Of course, just use a co...

4 years ago | 1

| accepted

Answered
Alternative to 'evalin' for pdepe solver
"Does anyone have a suggestion on how I can pass my 5 arguments into the pde function?" The recommended, documented, efficient ...

4 years ago | 0

| accepted

Answered
To add two datetime arrays , with millisecond values
You should be storing those times as duration objects (not as datetime objects) so you could simply add them. The solution to yo...

4 years ago | 0

| accepted

Answered
how to arrange vector to matrix?
x = [1,2,3,4,5,6]; m = hankel(x(1:4),x([4:6,1:3]))

4 years ago | 1

| accepted

Answered
textscan only reads first row of text file
fmt = 'Time%dG in body frame%f%f%fOmega%f%f%fr balane%f%f%fquat%f%f%f%fMag%f%f%f%f%f%f%f'; opt = {'Delimiter',{';',':',' '}, 'M...

4 years ago | 1

| accepted

Answered
Fill a vector with specific values from a matrix
a = [1,4,23,5;5,2,7,8;3,4,6,3]; b = a(a>4)

4 years ago | 1

| accepted

Answered
Input A of class cell and input B of class cell must be cell arrays of character vectors, unless one is a character vector.
Why are you inefficiently storing scalar numerics in cell arrays? Using numeric arrays would be much simpler and avoid this err...

4 years ago | 0

| accepted

Answered
Replacing Values of one matrix with another
isn_east = isnan(east); or simply: VV = Reference_E; VV(isnan(east)) = NaN;

4 years ago | 0

| accepted

Answered
Conversion of feet.inch to meter
Rather than abusing the definition of decimal numbers, a much better way to store feet and inches is in a matrix: FI = [6,5;5,9...

4 years ago | 1

| accepted

Answered
Why does the modulo function seem to break for large numbers?
You used a binary floating point number whose precision is limited to around 15-16 significant decimal digits. The output of MO...

4 years ago | 2

| accepted

Answered
Interleaved repmat (row duplication)
The simple and efficient approach is to use REPELEM: a = [1,0,0;0,0,1;1,1,1] b = repelem(a,2,1)

4 years ago | 2

| accepted

Answered
How to index into a table with more than 1 variable?
Where T is your table (do NOT use table as a variable name): out = T(ismember(T.name,a),:);

4 years ago | 0

| accepted

Load more