Answered
License Number* or Activation Key
Type license % in command window

7 years ago | 0

Answered
Short code for the expression
a = num2cell( (1-h) * repmat( (1-h) * 1 + h * P(1), 1, 4) + h * P ) ; [a1, a2, a3, a4] = deal( a{:} )

7 years ago | 0

| accepted

Answered
Changing Indexing Order in matrix raws
array1(array1~=0)=array2

7 years ago | 1

Answered
How to extend array?
repelem(A,B)

7 years ago | 1

| accepted

Answered
ERROR: Undefined function 'sum' for input arguments of type 'cell'. Kindly help me resolve the error.
% remove syms x p = sum(cell2mat(arrayfun(...))) % same goes for q

7 years ago | 1

Answered
horizontal concat of equi dimension matrix
cat(2,A1,A2,A3) %or [A1,A2,A3]

7 years ago | 0

Answered
How do I fit smaller matrix into a larger matrix
[m,n]=size(A); I = zeros(256); I(1:m,1:n) = A

7 years ago | 2

| accepted

Answered
Variable x must be of size [5 1]. It is currently of size [5 5]. Check where the variable is assigned a value.
<https://in.mathworks.com/help/matlab/ref/mldivide.html#bthh_f9>

7 years ago | 3

| accepted

Answered
eliminate indices that are empty
X={ 2 4 1 [] 5 2 2 7 8 [] 1 3}; idx=cellfun('isempty',X); X(idx)={NaN}; Wanted=mean([X{:}],'omitnan') ...

7 years ago | 0

Answered
I NEED TO DIVED TWO ARRAYS OF DIFFERENT SIZES
F(2:end)./R

7 years ago | 0

| accepted

Answered
extracting max and min range across column from matrix
arrayfun(@(x,y) x:y, min_of_A, max_of_A, 'un', 0)

7 years ago | 0

Answered
Factorial of a number up to n
prod(7:-1:4)

7 years ago | 0

| accepted

Answered
any simplified way to get the length of each variable in structure
arrayfun(@(x)length(x.a),test) % use numel if the variables are a vector , I didn’t download your file so not sure how your va...

7 years ago | 1

Answered
Function with duplicate name "aAcou1" cannot be defined.
Save the code in a separate file named as aAcou1.m , define c inside the function. Why so obssessed with that name ?? Why if you...

7 years ago | 0

Answered
How to store the output values in matrix?
Simply reshape x: reshape(x,8,[]) % or transpose according to your orientation *Note*: Preallocating a Variable is an...

7 years ago | 0

Answered
How to divide a string into substrings
Assuming your using version higher than 2016b of MATLAB: Str='A':'F'; Z=repmat(Str,strlength(Str)-1,1); f = @(x)regexp(""+x,'...

7 years ago | 0

| accepted

Answered
2D non-Square Matrix to 2D square matrix
Wanted = nan(length(A)); Wanted(1:numel(A)) = A

7 years ago | 1

| accepted

Answered
How to add values from vertcat to a script
Wanted = num2cell(M,1) [a,b,c,d]=deal(Wanted{:})

7 years ago | 1

Answered
Get the corresponding value of the matrix
b(any(abs(b-1.8339)<1e-4,2),:)

7 years ago | 0

| accepted

Answered
When The following error occurred converting from sym to double: Unable to convert expression into double array
T=sym(zeros(size(rho))); % before the line T(7)...

7 years ago | 2

Answered
matlab invalid expression issue
solar_cell = @(V_mp) exp((q.*V_mp)./(kb.*T(k))).*(1+((q.*V_mp)./(kb.*T(k))))-(exp((q.*V_OC)./(kb.*T(k))))

7 years ago | 0

Answered
How to use sprintf when the parameter contains an array cell
n=10; S=cell(n,1); for k = 1:n S{k}=sprintf('./DataBase/%d/(%d).png',[k;k]); ... some operation end

7 years ago | 1

| accepted

Answered
Error while integrating a piecewise constant function
integral(A1,0,1,'ArrayValued',1)

7 years ago | 1

Answered
Reading data from cell array
C = cell2mat(cellfun(@(x) x(1,:), A, 'un',0)); save mymat.mat C

7 years ago | 0

| accepted

Answered
Symbolic vectors 'invalid variable name'
sym('a',[1 4]) doc sym

7 years ago | 0

| accepted

Answered
What is the meaning of '+-' and 'o-'
<https://in.mathworks.com/help/matlab/ref/linespec.html>

7 years ago | 0

| accepted

Answered
Getting syntax error when using for loop.
r = linspace... % also consider preallocating x0

7 years ago | 0

| accepted

Answered
how can i turn the results from a column into a row
x = zeros(1,5); % for illustration purposes for k = 1:5 x(k) = k; end

7 years ago | 0

Answered
Int gives wrong(?) answer
int(x,0,1) => x^2/2 as Limits 1^2/2-0/2 => 1/2 % I don‘t see any mistakes ??

7 years ago | 0

Answered
Colon operator for cells
idx="Name"+(3:8); Tab1(ismember(Tab1{:,1},idx),:)

7 years ago | 0

Load more