A répondu
Grouped boxplot plots with different lengths and colors in different categories
One way: x1 = randn(10,1); x2 = randn(10,1); x3 = randn(10,1); y1 = randn(100,1); y2 = randn(50,1); y3 = randn(20,1); ...

16 jours il y a | 1

| A accepté

A répondu
how to manipulate fig file
Here's an example: % create a figure with a couple of plots and save it to a .fig file: f = figure(); subplot(2,1,1) plot(1:...

16 jours il y a | 0

| A accepté

A répondu
transform the cell 'string' containing strings into a single string
One way: load string.mat S = string; % I rename your variable "string" and clear it clear string % because I'm going to us...

16 jours il y a | 0

| A accepté

A répondu
If statements vs conditions
In this line, you have the entire array Asim_door (divided by A_fg) on the right side, trying to assign it to a subset on the le...

16 jours il y a | 0

| A accepté

A répondu
Separate categories in heatmap colorscale
One way would be to put a patch object over the particular cells of the heatmap that you want to be different. Here's a way to d...

17 jours il y a | 1

| A accepté

A répondu
I have a latitude longitude infos and a certain data. I am tryna do a 2D contour earth map using all of these. But result not right why ?
% some fake data: N = 17025; lat = rand(N,1)*180-90; long = rand(N,1)*360-180; m = rand(N,4); % Calculate the magnitude o...

17 jours il y a | 0

A répondu
Write table with with column names and subject ID
Make data a cell array and you can include row and column headers as desired. See below for how that might work. (I've also rep...

17 jours il y a | 1

| A accepté

A répondu
Graphic with line erros
% unzip the zip-file unzip('NC_file.zip') close all; clc; format long g; % input = 'C:\Users\vasco\OneDrive\Ambiente de...

17 jours il y a | 1

| A accepté

A répondu
how create cell array of blank space " "
Cell array: C = repmat({' '},1,5) or: C = cell(1,5); C(:) = {' '} A string array may be useful too: S = repmat(" ",1,5) o...

17 jours il y a | 0

| A accepté

A répondu
How to correctly use contourf with logarithmic color scale?
The problem is that contourf picks the levels in a linear fashion, so the levels in your contour plot are [0 0.1 0.2 0.3 ... 0.9...

17 jours il y a | 0

| A accepté

A répondu
plotting multiple plots in multiple figures inside a for loop
nPlots = 24; plotLayout = [2 4]; nPlotsPerFigure = prod(plotLayout); nFigures = ceil(nPlots/nPlotsPerFigure); for ii = 1:n...

17 jours il y a | 0

A répondu
replace character in array cell
Here are a couple of guesses: load matlab_bubu M = vertcat(bubu{:}); idx = M(:,1) > 0; T1 = string(M(:,1)); T1(idx) =...

18 jours il y a | 1

| A accepté

A répondu
How to extract specific elements from a struct variable?
load trackResults2.mat % idx is a logical vector, with one element for each row of trackRes.traces, % which says whether the...

18 jours il y a | 0

| A accepté

A répondu
How to break a single horizontal line in the legend of a Matlab plot into two horizontal lines?
legend([pl_1, pl_6, pl_s_1, pl_s_6, pl_s_3, pl_s_7], ... {'disc (impuls)', 'disc (step)', 'stoch1 (impuls)', 'stoch1 ...

19 jours il y a | 0

| A accepté

A répondu
Two surf plots in the same figure
"seems as if the axes limits are not getting updated as per the set values" Set the axes limits after plotting: figure; ra = ...

19 jours il y a | 0

| A accepté

A répondu
I have a table in workspace and want to plot the data in it. How do I do that?
If T is the name of your table variable, then: plot(T.Time, T.Voltage)

20 jours il y a | 0

A répondu
Trouble importing data from folder
ls returns a 2d character array in general (on Windows), but regexp expects a character row vector. You can covert the output of...

20 jours il y a | 0

A répondu
how to convert vector in string as example
c=1; a=[4 7] sprintf("cnt %d - [",c) + num2str(a) + "]"

20 jours il y a | 2

| A accepté

A répondu
Logarithm with a variable base
k=2 log(8)/log(k)

20 jours il y a | 3

| A accepté

A répondu
i want to write shorter code
b=[0 1 1 0 0] b|b.'

21 jours il y a | 0

| A accepté

A répondu
create a pie subgraph with assigned percentage values
number = [78 79 80 81 82 83 84 85 86 87 88]; value = [4509 5239 6400 9074 11047 13147 15137 13909 6354 1152 183]; str = 'exa...

21 jours il y a | 0

| A accepté

A répondu
Horzcat Error in 3x3 matrix with multiplication of Matrices
You've got the scalar zero in there causing the problem. Replace that scalar zero with a vector of zeros the same size as Latty ...

22 jours il y a | 1

| A accepté

A répondu
How to create an uifigure with gcf
"Currently, if an uifigure exists and you call gcf, a new java-based figure() is created." That's not necessarily true. gcf() c...

22 jours il y a | 1

A répondu
Why am I getting zeros
Latty = [38; 39; 37; 40; 39; 36; 39; 39; 38; 40; 35; 37; 38; 40; 40; 37; 36; 36; 39; 36; 40; 35; 39; 35; 39; 39; 35; 38; 39; 38;...

22 jours il y a | 1

| A accepté

A répondu
Fill a matrix from a matrix of indices
Something like this? load my_flow.mat load mask.mat load IJ.mat % visualize mask and I2/J2 p = pcolor(mask); p.EdgeColor...

22 jours il y a | 0

| A accepté

A répondu
Help with creating an array from two smaller arrays in a for loop
L = 8; n = 12; X1 = linspace(0,L/2,n/2); X2 = linspace(L/2,L,n/2); Mx1 = 25.*X1; Mx2 = 25.*X2 - 50.*(X2-4); Fv = [Mx1 ...

23 jours il y a | 0

| A accepté

A répondu
Missing counts during histcount?
I suspect that the data you are using histcounts on has elements outside the range of bin edges you have specified. For example...

23 jours il y a | 0

A répondu
I am working with Galois field. I obtained all the 256 values, and now i want to make the matrix form of the obtained values.
clear all; close all; clc; m = 8; p = 2; prim_poly = p^8+p^6+p^5+p^1+p^0; a = gf(35, m, prim_poly); ...

23 jours il y a | 0

A répondu
why the plot does not appear in the axes, what did i do wrong?
energyConsumption is a scalar. Perhaps you meant to use cumtrapz instead of trapz. fr = 0.015; %Coeffcient of rolling resistanc...

23 jours il y a | 0

A répondu
Plot multiple variables from table with different x axes
ncol = size(Map1,2); for i=1:ncol/6 h=stairs(Map1.(sprintf('Distance_%d',i)),Map1.(sprintf('Ca_%d',i))); hold on end...

23 jours il y a | 1

| A accepté

Charger plus