Respondida
how to add and to remove cell arrays?
Properties = { ... 'Aluminium' 780; ... 'Steel' 30; ... 'Titanium' 430; ... 'Copper' 300; ... ...

alrededor de 4 años hace | 0

Respondida
unable to get desired results
Maybe this? User = zeros(1,10); p = 0.785; for i = 1:10 probability_of_transmission = rand(1); if probability_of_...

alrededor de 4 años hace | 0

| aceptada

Respondida
Change line width in graph
h2 = findobj('Type', 'line') % h2 = % 5×1 Line array: % Line (TimeZeroLine) % Line (Cursor) % Line % Line (DataL...

alrededor de 4 años hace | 0

| aceptada

Respondida
Finding the first index in the datasets with a gap
Let me reproduce your image first: % load and plot data data = readmatrix('Data.xls'); plot(data(:,1),data(:,2),'r','LineWidt...

alrededor de 4 años hace | 0

| aceptada

Respondida
ifft function of matlab, applied on simulated signal in attached .mat file, returns NaN as real part!
Looks like the NaNs come from the first element of Reflection: load ('Question_Mathworks.mat'); whos Reflection % real part o...

alrededor de 4 años hace | 0

| aceptada

Respondida
Using Conditions from One Array To Select Data from Another
load comyearlatlong.mat load year_weak_elnino.mat whos *year* [ism,idx] = ismember(comyearlatlong(:,1),year_weak_elnino); wh...

alrededor de 4 años hace | 0

| aceptada

Respondida
How to average first 7 values of all the column and put into new row then next 7 untill the end of data
Does this work for what you want to do? % read the file, skipping the first 8 lines, and make a table t % using the variable ...

alrededor de 4 años hace | 1

| aceptada

Respondida
How can I repeat a 2-D array to create a 3-D array?
% what you have now: A =[1 2 3;4 5 6]; for j=1:5 B(j,:,:)=A; end % another way, using repmat and permute: B_new = re...

alrededor de 4 años hace | 0

Respondida
Arrays have incompatible sizes for this operation
R1_matrix and Rm_matrix are 1x400: load R1_matrix load Rm_matrix whos R* Therefore, the expression involving subtracting Rm_...

alrededor de 4 años hace | 0

Respondida
How to find the index of missing values in a cell array without looping through each element?
You can use cellfun to call ismissing on the contents of each cell: S1 = struct(); S2 = struct(); C = {S1 S2 missing} is_mis...

alrededor de 4 años hace | 0

| aceptada

Respondida
Error using plot Data must be a single matrix Y or a list of pairs X,Y.
Try changing this line: plot(x_cubic, y_cub, 'LineWidth', 3, 'g'); to this: plot(x_cubic, y_cub, 'LineWidth', 3, 'Color', 'g'...

alrededor de 4 años hace | 2

| aceptada

Respondida
I want to import a specific string from a column from an excel sheet I imported using logical indexing
Let's say you've used readcell to read the file into this cell array: data = { 'other' 'LMI' 3 'stuff'; ... 'colu...

alrededor de 4 años hace | 0

Respondida
Extract data range from nested cell array
This syntax should work "to extract, from the first sheet (i.e. {1,1}), the 2nd till the 7th elements from row 8": cell_array{1...

alrededor de 4 años hace | 0

| aceptada

Respondida
Symbolic expression for exponential decay
exp(-t/tau) is an exponential function of t, whose value is 1 at t = 0, whose value is less than 1 for t > 0, and whose value is...

alrededor de 4 años hace | 0

| aceptada

Respondida
Spectrogram not completely showing from Audio Signal
You say the sampling rate is 33600 (Hz, presumably), but in fact the code uses a sampling rate of 1000 Hz, which is insufficient...

alrededor de 4 años hace | 0

Respondida
How can I modify my subplot positions to stop them overlapping each other?
The code you have is explicitly setting the positions of the axes to be the same (i.e., each axes in one set of three axes has t...

alrededor de 4 años hace | 0

| aceptada

Respondida
I do not know how to make this condition on the hue work
What if you try this: for row=1:size(imagea,1) for col=1:size(imagea,2) % if abs(Hue(row,col) - huev) < 0.1; ...

alrededor de 4 años hace | 0

Respondida
How to plot planes parallel to the coordinate axes given by
y = linspace(0,5) ; x = linspace(0,5) ; [Y,X] = meshgrid(y,x) ; % Z = 3 ; Z = 3*ones(size(X)); surf(X,Y,Z) hold on ...

alrededor de 4 años hace | 0

| aceptada

Respondida
How to post the values in the middle of a stacked bar plot?
x = [0 0 20 52.5 27.5; 5 10 50 20 15; 2.5 5 25 47.5 20; 5 5 42.5 45 2.5; 2.5 27.5 40 27.5 2.5; 2.5 12.5 65 20 0] [m,n] = size(x...

alrededor de 4 años hace | 2

| aceptada

Respondida
Findpeaks and maxk without sorting
% a smaller example: Pilant_Vy_envR = zeros(13,2); Pilant_Vy_envR(2:3:end,1) = [30; 15; 10; 20]; Pilant_Vy_envR(3:3:end,2) = ...

alrededor de 4 años hace | 0

| aceptada

Respondida
How to multiply a 3d array with a 2d matrix?
% Initialize array mtx_c [N,M,~] = size(mtx_a); P = size(mtx_b,2); mtx_c = zeros(N,M,P); % mtx_a must be permuted to 128x6...

alrededor de 4 años hace | 1

Respondida
how to make a number to vector?
It's not clear what you want, but here's a way to get a number from the user and make a vector of its digits (assuming it's a po...

alrededor de 4 años hace | 0

| aceptada

Respondida
How to write a Image with Alpha channel ?using imwrite matlab command?
% original image RGB=imread('football.jpg'); imshow(RGB) Use .png format with Alpha parameter in imwrite % Attempt to make t...

alrededor de 4 años hace | 0

Respondida
CONNECT TWO gui.FIG IN GUI matlab
Here is a working example, where clicking the pushbutton in the first figure clears the axes in the second figure. The figures,...

alrededor de 4 años hace | 0

Respondida
Parse cell array into separate cells, with no delimiter
fileName = {'11171401'; '22282512'; '33393623'}; [track,cycle,segment] = cellfun(@(x)parse_file_name(x),fileName,'UniformOutp...

alrededor de 4 años hace | 1

| aceptada

Respondida
Mean of each Value in a Cell Array
% a cell A (107x3), with each 14x8 double A = arrayfun(@(~)randn(14,8),zeros(107,3),'UniformOutput',false) % I want to create ...

alrededor de 4 años hace | 1

| aceptada

Respondida
how to create random vector?
A vector of 5 random 19-digit numbers (change n_digits to 25 to get 25-digit numbers): n_numbers = 5; n_digits = 19; digits...

alrededor de 4 años hace | 0

Respondida
Error message I don't understand
I believe some older versions of MATLAB require the first argument to xline to be a scalar. To get around that, you can call xli...

alrededor de 4 años hace | 0

Respondida
If else -statement doesn't work
Initialize the table: taAct= array2table(randi([0 30],8,3)); %making a table as my final dataset is as table taAct.Sum = sum(t...

alrededor de 4 años hace | 1

Respondida
how to remove the zeros inside a 3D matrix?
Here's one way: % a (slightly) smaller example, to demonstrate Xroot = zeros(7,15,402); % with a few non-zero elements in con...

alrededor de 4 años hace | 0

| aceptada

Cargar más