Respondida
Zero Matrix Values using Indices
Speed_ENU = [1,3,6,14,25,33; 11,12,15,45,15,67;1,32,16,4,25,3; 11,12,5,45,15,7;11,32,6,4,25,33; 1,12,5,44,15,67;11,31,6,4,25,3; ...

casi 4 años hace | 0

| aceptada

Respondida
Create column into struct if 'if statement' met a condition
Here's one way: % construct a modified version of your variables: shape_area = [ ... struct('Geometry','Polygon','Column1...

casi 4 años hace | 0

Respondida
Requested 250000x250000 (931.3GB) array exceeds maximum array size preference
One of them is a 1x250000 row vector. You can transpose that one, or you can convert it (or both) to column vector(s): x1(:).*x...

casi 4 años hace | 3

| aceptada

Respondida
extract numbers from a string.
str = '"sensor_serials": {"H1": "3637", "H2": "3638", "H3": "2787"}' numbers = regexp(str,'"(\d+)"','tokens'); numbers = [num...

casi 4 años hace | 0

| aceptada

Respondida
How to remove a slash from fullfile?
Combine the 'MC_' and the i into a single argument. Like this: wtf= fullfile('C:\','Users','jessi','Desktop','HydrusMC','Simul...

casi 4 años hace | 0

Respondida
Replacing NaN with char
A = [1; 2; 3; NaN; 5; NaN;]; a = num2cell(A); a(isnan(A)) = {'Example'}; disp(a);

casi 4 años hace | 0

| aceptada

Respondida
How to convert 3D cell of different dimensions to a single matrix
Maybe this does what you want: cat(3,hDp{:})

casi 4 años hace | 0

Respondida
checking folder has more than one file with similar name
% use the name of the folder you want to check: folder = './'; % get info about the files in that folder whose name starts w...

casi 4 años hace | 0

| aceptada

Respondida
How do I access data inside a struct that is inside another struct that is inside a cell array
If B is the index of the struct you want in cell array A, C is a field of that struct, etc. A{B}.C.D

casi 4 años hace | 0

Respondida
How to extract particular row values from cell arrays with varying cell lengths?
N = numel(x.total_states); first_fragment_labels = cell(1,N); first_fragment_signal = cell(1,N); for ii = 1:N ...

casi 4 años hace | 0

| aceptada

Respondida
How do I compare values within a for loop using if/else?
Seems like you want to compare one element of Vx and Vy at a time: if Vx(i,j,k) == Vy(i,j,k) disp('X = Y') elseif...

casi 4 años hace | 1

| aceptada

Respondida
How can i open a list of files?
folder = 'Path\to\your\directory'; old_ext = '.txt'; % original extension new_ext = '.dat'; % new extension old_files = dir...

casi 4 años hace | 0

Respondida
Modifying MATLAB code according to conditions (MATLAB)
B = max(A); C = find( A == B , 1 ); Or [B,C] = max(A);

casi 4 años hace | 0

| aceptada

Respondida
matrices specific value selection
Like this? % constructing your B.values B.values = cat(3,[ ... 92 99 1 8 15 67 74 51 58 40 ...

casi 4 años hace | 0

| aceptada

Respondida
splitting Cell array in a loop
X = 1:32; Y = cell(1,4); j = [1,9,17,25]; for i = 1:numel(j) Y{1,i} = X(j(i):j(i)+7); end disp(Y) Or: Y = num2cell(...

casi 4 años hace | 0

| aceptada

Respondida
Creating vector from a cloumn of a matrix
Transpose the column: RowMatrix = Matrix(:,1).' https://www.mathworks.com/help/matlab/ref/transpose.html

casi 4 años hace | 0

| aceptada

Respondida
How to summation using for loop with a vector
"... not to sure how to make a for loop for SXY ..." The square brackets give you a syntax error: for [i = 100] Removing them...

casi 4 años hace | 1

Respondida
How can I find an specific value inside an array without using the find function?
You can use the max function with second output argument, applied to the logical array w>=10, in order to return the first index...

casi 4 años hace | 0

| aceptada

Respondida
how to expand a Square matrix and reverse to its original form ?
Here's some code that generalizes the example for any n (size of original matrix), except this expands the matrix to size n^2-by...

casi 4 años hace | 1

| aceptada

Respondida
Find differences between 2 tables
If your tables are the same size and both contain all numeric data, then this would work: % create some tables: t1 = table([1;...

casi 4 años hace | 0

Respondida
Simulating pendulum with a for loop
Notice that in each iteration of your loop you plot one point: (A(i),B(i)). That's why only the end of the pendulum shows up. If...

casi 4 años hace | 0

Respondida
Bar figure helps with group on the x-axis
Like this? x = [1.2132312 5.3413413212]; vals = [1.12234 1.34234 0.52342741238 2.4132213 3.1231232 5.123123 8.123123;5.7933711...

casi 4 años hace | 0

Respondida
Writing a long equation in MATLAB
There are a couple of errors with the parentheses: d = ((1/(gamma*(abar(t-1,1) - a(t-1,1))))*(1+(a(t-1,1)/(gamma*(abar(t-1,1) -...

casi 4 años hace | 0

| aceptada

Respondida
Accessing and using struct array using vectorization
aa = vertcat(list_el{:,1});

casi 4 años hace | 0

| aceptada

Respondida
Plot axis limits different between figure and print
What happens if you resize the figure before calling print()?

casi 4 años hace | 0

| aceptada

Respondida
How can I concatenate or merge cell in Array
A = [2 3 5; ... 6 7 6; ... 5 7 1]; C = num2cell(A,1) celldisp(C)

casi 4 años hace | 0

| aceptada

Respondida
find the index who have the max value in cell structure
ex1=[1 2 3]; ex2=[0 3 2]; for i=1:3 a(i).b = struct('ex1',ex1(i),'ex2',ex2(i)); end temp = [a.b]; posidx = find([tem...

casi 4 años hace | 1

| aceptada

Respondida
how can I plot the following graph
nz = 50; nt = 7; z = linspace(0,3500,nz); F = max(0,1000+1000*sin(z(:)/500+(1:nt)*pi/2)+500*randn(nz,nt)); colors = jet(nt...

casi 4 años hace | 1

Respondida
Identify duplicates in a matrix and keep the one with minimum value
A = [1500 12 1; 1500 10 2; 1500 11 3;1500 15.61 6;1500 17 5;1500 15.56 4;2000 12.08 8;2000 13 8;2000 12.12 7;1...

casi 4 años hace | 1

| aceptada

Respondida
Interp1 question on excel data with multiple columns and blank/empty cells
% read the file: M = readmatrix('p_d_FlameSpeed.xlsx'); % construct a cell array of two-column matrices of d and p values %...

casi 4 años hace | 1

| aceptada

Cargar más