Respondida
Plot legend in a bar graph
Month = {'April'; 'May'; 'June'; 'July'; 'August'; 'September'; 'October'; 'November'; 'December';'January'; 'February'; 'March'...

alrededor de 4 años hace | 1

Respondida
How can I read CSV file and plot without removing header?
A = readtable('v1.csv') figure; plot(A{:,1},A{:,2},'-','LineWidth',1.5,'color',[30,129,176]/255); hold on; plot(A{:,1},A{:...

alrededor de 4 años hace | 1

| aceptada

Respondida
if-elseif-else statement take turns/used each of them in while loop, how to write properly?
Like this? i=0; while i <= 20 i = i+1; r = rem(i,3); if r == 1 disp('its first num') elseif r == ...

alrededor de 4 años hace | 1

| aceptada

Respondida
How to store data from a nested For loop
x = -500:500:500; % X range y = -500:500:500; % Y range "The" MATLAB way: [xx,yy] = meshgrid(x,y); xy_coord = [x...

alrededor de 4 años hace | 0

Respondida
how to store value in variables of one column in cell array from another column in cell array?
% your V_table: V_table = table( ... {'Lser_B7Tx';'Lser_B7Rx';'QCsmd';'QLemb';'Lshu_B7';'fQ';'Cshu_B7';'QLsmd'}, ... ...

alrededor de 4 años hace | 1

| aceptada

Respondida
How to multiply scalar and matrix(i set her in ''uitable1'') in GUI?
Use the Data property of the uitable data = get(handles.uitable1,'Data') There's no telling (based on the code we can see) wha...

alrededor de 4 años hace | 0

| aceptada

Respondida
Spit an array when the value 0 occurs until the value 2
% an array time (6700x1) containing numbers from % -8 to 5 in ascending order: time = linspace(-8,5,6700).' % time_new based...

alrededor de 4 años hace | 1

| aceptada

Respondida
Last value of Moving Average in single command
Here's a way: A = rand(10,1); % original, for reference: B = movavg(A,'exponential',2); C = B(end) % single-line command...

alrededor de 4 años hace | 0

| aceptada

Respondida
How to store multiple iterations of a 3x3 matrix using a for loop.
Use a 3-dimensional array of size 3-by-3-by-n: t_0 = 0 t_finish = 120 n = 0 for int = t_0:t_finish n = n + 1 Cpp_...

alrededor de 4 años hace | 0

Respondida
How to create answers to a calculation in an array in a forloop ?
Nbins = numel(edges)-1; BinSums = zeros(1000,Nbins); for jj = 1:1000 % ... % different a and b each time ...

alrededor de 4 años hace | 0

| aceptada

Respondida
Fill a column in a table with an array
% a table T of a certain height: T = table((1:10).',char((65:74).')) % a 1x1 duration array: D = duration() % populate a new...

alrededor de 4 años hace | 1

| aceptada

Respondida
Error setting property 'YLabel' of class 'Axes':
The YLabel is a text object. You mean to set its String property: figure; ax = gca; ax.YLabel.String = "[Pressure [Pa]]" ; ...

alrededor de 4 años hace | 1

| aceptada

Respondida
How to reshape any matrix using while loop or any other method?
Here's one way, based on the assumption that it goes A(:,[1,2,3,...,20,21,22,...]) = B(:,[1,7,13,...,115,2,8,...]) % 5x120 mat...

alrededor de 4 años hace | 0

| aceptada

Respondida
Loop with 2 diferent iterations conuntings
total_count = 0; conditional_count = 0; max_iter = 10000; for iter = 1:max_iter total_count = total_count + 1;...

alrededor de 4 años hace | 0

Respondida
Finding if the value is present in the table using readtable
Try this: A = readtable('dataset1.xlsx'); % use 's' argument in input(), so that the user input % is stored directly in te...

alrededor de 4 años hace | 0

| aceptada

Respondida
How to Extract 2048 values containing the maximum value?
"I want to plot only the largest 2048 values" A = readmatrix('Data2048.txt'); A = sort(A,'descend'); plot(A(1:2048))

alrededor de 4 años hace | 1

Respondida
Error using / Matrix dimensions must agree
Use ./ r=linspace(-180,180,360); t=linspace(-180,180,360); [R,T]=meshgrid(r,t); % phi_=6*r*cos(1+5^2/R.^2)-T; phi_=6*r*cos(...

alrededor de 4 años hace | 0

| aceptada

Respondida
Index exceeds the number of array elements - Error message
Here's one way to determine the number of iterations required: clear all mdata = [1 2 3 4 5 6 7 8 9]; n1 = 1; k = 1; N ...

alrededor de 4 años hace | 0

| aceptada

Respondida
Colorbar from an array
unzip data.zip [A,R1] = geotiffread('MOD06_L2.A2018001.1500.CER.WGS84.RAMIS.tif'); A = uint16(A); brown_color = [0.5 0.2 0....

alrededor de 4 años hace | 1

| aceptada

Respondida
How can I plot square waves with an increasing/decreasing linear pattern?
%given k_num=-45.6992; h_num=60.3496; %plotting lines of triangle plot([k_num,0],[h_num,2*h_num],'m') hold on radius=sqr...

alrededor de 4 años hace | 0

| aceptada

Respondida
Creating xlsx with multiple sheets
Here's one way, demonstrated with random data (random DateNtime(:,2)): %% Define date&time arrays : t1 = datetime(2021,6,21,1,...

alrededor de 4 años hace | 0

| aceptada

Respondida
How to loop all slice locations from a image volume as a single column vector?
Move the last two lines inside the loop and assign info.SliceLocation to the kth element of slLoc: %% close all; clear; clc; ...

alrededor de 4 años hace | 0

| aceptada

Respondida
Datetime won't recognise some cells
load datetime-problem.mat databackup.TimeofDay % original Format specification: datetime(databackup.TimeofDay,'Format','HH:mm...

alrededor de 4 años hace | 1

Respondida
How to retrieve index in a matrix
One way is to find the index of the minimum in each column of A one at a time, setting that row of A to NaN each time so that th...

alrededor de 4 años hace | 0

| aceptada

Respondida
plot using user custumized legend lines
The set of colors of the lines in the legend doesn't match with the set of colors of the circles because the xlines and ylines a...

alrededor de 4 años hace | 1

| aceptada

Respondida
Is there a way to display ALL y points for each x point ?
Here's an approach that might work ok. The idea is to use the figure's datacursormode with a custom UpdateFcn that sets the data...

alrededor de 4 años hace | 1

| aceptada

Respondida
Error - I am new to Matlab and I just need help to graph this data I am getting a strange error.
t is a vector, so you need to use element-wise operations with it, e.g., .* ./ .^ Also, the way you defined your for loop, k is...

alrededor de 4 años hace | 0

Respondida
Compact way to extract day and hour from a datetime / datestrings format ?
time_array = { ... '17-Jun-2017 0:00:00'; ... '17-Jun-2017 1:00:00'; ... '17-Jun-2017 2:00:00'; ... ... ...

alrededor de 4 años hace | 1

| aceptada

Respondida
Function not processing dat for each element in array
The n given to tempcorrect is a vector (of length 10000). When you use a vector (or matrix, or any array) in an if statement, th...

alrededor de 4 años hace | 0

| aceptada

Respondida
How do I turn string "C = A*B" to "data.C = data.A.*data.B " while the equation and variables may change?
Maybe this is worth a try: % example usage fix_formula("C=A*B") fix_formula("A=B+C/D") fix_formula("A=B^2-C") % running it ...

alrededor de 4 años hace | 0

| aceptada

Cargar más