Respondida
Extract specific hour data from timetable
I assume that's 8AM to 4PM inclusive. Here's one way: T = readtimetable('T.xlsx'); disp(T) % original tod = timeofday(T.tim...

más de 2 años hace | 0

| aceptada

Respondida
For a known number of plots on the same axis, how do I set the colourscale?
data = (1:100).'+(1:20); n_lines = size(data,2); colors = jet(n_lines); figure colororder(colors); plot(data)

más de 2 años hace | 0

| aceptada

Respondida
Is it possible to use the 'patch' function to display missing intervals in only one of the graphs created with the given code?
EDIT to include OP's data, which I missed initially. EDIT to include a patch face for missing data at the start or end of a fil...

más de 2 años hace | 2

| aceptada

Respondida
Multiplying two variables in a table together
T.Power = T.Voltage.*T.Current; where T is your table.

más de 2 años hace | 1

| aceptada

Respondida
How to make a loop end when you reach the end of some data
counter = 0; for ii = 1:numel(data) if condition counter = counter+1; end end

más de 2 años hace | 0

Respondida
How to determine if an axes already has a colorbar?
There is a hidden axes property called 'Colorbar', which you can use. % two axes, one with colorbar, one without ax = subplot(...

más de 2 años hace | 1

| aceptada

Respondida
pérdida de colormap despues de activar y desactivar eje Y secundario en appdesigner
From the "Tips" section of the yyaxis documentation: "To clear the active side, use cla. To clear both sides of the axes and re...

más de 2 años hace | 1

| aceptada

Respondida
How to Add Border to Single Color Region in pcolor Plot
load TestData [m,n] = size(medianVarianceAll2); [X,Y] = meshgrid(1:m,1:n); figure h = pcolor(X',Y',medianVarianceAll2); c...

más de 2 años hace | 1

| aceptada

Respondida
Why between(datetime1, datetime2) is different from (-1)*between(datetime2, datetime1)?
From the between documentation: "In general, t2 is not equal to t1 + dt, unless you include 'time' in components."

más de 2 años hace | 1

Respondida
Matlab error how to fix?
"creating a m by 2 matrix where the first column is a datetime and second column is numeric" You cannot mix data types in a mat...

más de 2 años hace | 0

Respondida
Non-numerical data is still being loaded onto table. Need advice.
Note that the table returned by readtable is stored in app.dataTable before it's checked for non-numeric variables, so other par...

más de 2 años hace | 0

| aceptada

Respondida
Solving an array without for loops
permute might be useful. Example: Array_1 = rand(3,10); % size of Array_1: [3, 10] Array_2 = rand(3,15); % size of Array_2: [3...

más de 2 años hace | 0

Respondida
Unable to display uicontrol within a given panel?
"checkbox1 = uicontrol(ax2, ...)" won't work because an axes cannot be the parent of a uicontrol, as the error message said. "...

más de 2 años hace | 0

Respondida
Fill area between two lines
It looks like xxO is a row vector and envelopeminO and envelopesupO are column vectors (any other combination would work properl...

más de 2 años hace | 2

Respondida
Circular shifting or rotating structure of array elements
A 1x3 array of structures: S = struct('x',{4 20 5},'y',{8 24 15}) S.x S.y 1. Shift the third element to first one using circ...

más de 2 años hace | 0

| aceptada

Respondida
Circular shifting or rotating structure of array elements
A structure of arrays: S = struct('x',[4;20;5],'y',[8;24;15]) S.x,S.y 1. Shift the third row to first one using circshift: S...

más de 2 años hace | 0

Respondida
How to use for loop and get the result for each index varian?
"after running, it only gives the last model's result" Of course, because Optimizevalue is overwritten on each loop iteration. ...

más de 2 años hace | 0

| aceptada

Respondida
Multiple Uses of UIMENU
"there seems to be a lot of duplicity. Is there a more elegant way to ahcieve this" Multiple components (e.g., uitables) can ...

más de 2 años hace | 0

| aceptada

Respondida
How to adjust color of each bar in a grouped bar plot?
% data = [F_CRPS_ip A_CRPS_ip; F_CRPS_is A_CRPS_is; F_CRPS_rho A_CRPS_rho]; data = rand(3,2); y = data; x = ["I_P" "I_S" "...

más de 2 años hace | 0

| aceptada

Respondida
Program not generating 0 as expected to turn variable cell to double
newZ1 = Z2*ceil(Z1/Z2); That makes each element of newZ1 the lowest multiple of Z2 greater than or equal to the corresponding e...

más de 2 años hace | 0

| aceptada

Respondida
It keeps giving me an error on my xlim and the graph that it gives me isn't complete
xlim should be specified as a 1x2 numeric vector of increasing values, e.g., xlim([0.3 1]); not as a character vector (with s...

más de 2 años hace | 1

| aceptada

Respondida
How can I modify the following code to send data row by row instead of column by column using UDP?
"I have data with five columns" I assume that's the variable data in your code. You can write data by row the exact way you ar...

más de 2 años hace | 0

Respondida
How to send Table using UDP in MATLAB
According to <https://www.mathworks.com/help/instrument/udpport.write.html the documentation>, the "data" input is: "Vector...

más de 2 años hace | 0

Respondida
Importing data to 3D array in matlab
Since each file has a different number of x,y, it'll be more convenient to use a cell array: Data = cell(1,nfiles); for ...

más de 2 años hace | 0

| aceptada

Respondida
How to save a text file with number and text information?
Put the filenames in cell arrays. Example: lat1=1.2; lat2=3.2; long1=-44; long2=-34; grd='map.grd'; fault='fault.txt'; % fi...

más de 2 años hace | 0

| aceptada

Respondida
quiver plot on an image
"Is there any way to superimpose quiver plot on imshow function?" Yes. % read an image: img = imread('peppers.png'); % imsho...

más de 2 años hace | 0

| aceptada

Respondida
How to display rectangle ROI that was loaded from a file?
You can set the saved rectangles' parent to be a different/new axes. Example: % plot some rectangles: xlim([0 1]) ylim([0 1]...

más de 2 años hace | 0

| aceptada

Respondida
How to get a bar plot with unequal bin intervals?
bin_edges = [0 5 20 100]; % include the last edge (100) bar_heights = [20 10 30]; bar(bin_edges,[bar_heights(:); 0],'histc') %...

más de 2 años hace | 0

| aceptada

Respondida
How to change colors in my legend that is classified into three intervals?
Try storing the line handles returned from the m_plot calls, and then use those line handles in the legend call. That fixed the ...

más de 2 años hace | 0

Respondida
add element in table
% load stuff from the mat files: d1 = load('matlab_d1.mat','d1').d1; ff = load('matlab_ff.mat','ff').ff; d1 ff Name in ta...

más de 2 años hace | 0

| aceptada

Cargar más