Answered
third index in three dimention array
Imagine that 2 X 3 matrix is copied 4 times.

6 years ago | 0

Answered
Find the first incidence of 1 in a logical vector and replace all other 1s by zero
Wanted = (cumsum(matrix, 2) == 1) .* matrix

6 years ago | 3

| accepted

Answered
How to sort (ascending or descending) a list of ID numbers based on the value in a corresponding vector
Index second output of sort() to ID.

6 years ago | 0

| accepted

Answered
How do I find the max value of rows in a table?
MAX_rows = max(TabLe{:, :}, [], 2)

6 years ago | 0

| accepted

Answered
Inputting a Value from a Matrix into a command for automation using looping statements .
for k = 1:numel(Time) command(Time(k)) % who knows what this function does, perhaps it can be easily vectorised end...

6 years ago | 0

Answered
delete zeros from matrix
p4(:, all(p4 == 0)) = []

6 years ago | 1

Answered
Problem with using 'DisplayName' property in fplot()
F = fplot(f); set(F, 'DisplayName', 'Test')

6 years ago | 0

Answered
Index not working - very simple problem!
idx = abs(INSW - 3) < 1e-2; set tolerance

6 years ago | 0

| accepted

Answered
Ignore NaN values when sorting
[~, where] = sort(A); Wanted = where .* ~isnan(A)

6 years ago | 2

Answered
Problem with latex interpreter
str='$\frac{\tilde{y}(t)}{\sigma_{\eta(t)}}$'; ylabel(str,'Interpreter','latex')

6 years ago | 0

Answered
How to display a particular row of a matrix using loop
AR = num2cell(AR, 2); celldisp(AR)

6 years ago | 0

| accepted

Answered
Matrix multiplication with constant
k = RR * RS

6 years ago | 1

Answered
Matrix must be square
p.^-1

6 years ago | 0

| accepted

Answered
三次元行列の作成
I = num2cell(Images); W = cat(3, I{:});

6 years ago | 0

Answered
adding element to the beginning of an array
b(1:numel(a)) = a

6 years ago | 2

| accepted

Answered
For elements in two arrays/columns of numbers, how can I find the average only if both elements are non-zero?
matrix(matrix == 0) = nan nanmean(matrix, 2)

6 years ago | 0

| accepted

Answered
Different Colors On Single Line With LaTeX Interpreter
text(.1,.1,'^{{\color{red}Red}}/_{{\color{blue}Blue}}{\color{green}Green}')

6 years ago | 1

| accepted

Answered
readtable of csv with empty cells gives NaN and ' '
c = TablE{:, :}; c(cellfun('isempty',c)) = {nan}

6 years ago | 0

Answered
Extract values from vector with cell indices
cellfun(@sum,c)

6 years ago | 0

| accepted

Answered
Vector substitution into symbolic function
d2n_dl2 = matlabFunction(d2n); d2n_dl2subs = d2n_dl2(L)

6 years ago | 0

Answered
View (Extract?) data (from table) of struct array.
Session.wf

6 years ago | 0

Answered
Removing multiple substrings in a string
regexprep(String, '[a-z]*', '')

6 years ago | 0

Answered
Line 34 * unknown operator
After the second loop use {} instead of () by the way those two loops can be reduced to one single loop.

6 years ago | 1

| accepted

Answered
Index in position 2 exceeds array bounds (must not exceed 2).
Never name a variable *fill* ! ix = FiLL(2, :) == 0; FiLL(:, ix) = []

6 years ago | 0

| accepted

Answered
how to pick max value in different matrix
ABC = cat(3,A,B,C); D = max(ABC)

6 years ago | 0

Answered
how to pick max value in different matrix
max([A, B, C])

6 years ago | 0

Answered
Find indices of elements for given difference
Nearest element after or equal to the boundary: Dt = t - (10:10:max(t)).'; Dt(Dt<0) = inf; [~, Indices] = min(Dt,[],...

6 years ago | 0

| accepted

Answered
Eig(A) returns long fractional answer instead of a single number
sympref('FloatingPointOutput',1) % run this once and you don’t have to call vpa() or double() every single time doc sympref

6 years ago | 0

Answered
Creating a matrix using the colon function
ix = max(diff([A;B])); c = cumsum([A;ones(ix, numel(A))]).'; % if the difference between each A and B elements are the same ,...

6 years ago | 1

Load more