Community Profile # Voss

Last seen: Today Active since 2013

#### Statistics

All
• • • • • • • • • • • • #### Content Feed

View by

Having multiple different bins in a histogram that don't overlap
Maybe something like this? sensorVoltage = 5*rand(12,100)%test array - normally i would have voltage data figure('Position',...

3 hours ago | 0

Operator '>' is not supported for operands of type 'cell'.
T = readtable('T.xlsx'); T.Properties.VariableNames = num2cell(char(64+(1:size(T,2)))) "extract rows +/- 1 where columns T And...

3 hours ago | 0

An easy way to add the mean to boxplotGroup of Adam Danz?
rng('default') x = {rand(100,4), rand(20,4)*.8, rand(1000,4)+.2}; means = cellfun(@(x)mean(x,1),x,'UniformOutput',false); ...

6 hours ago | 1

| accepted

Draw the surface of a two variables function
[X,Y] = meshgrid(-1:0.1:1); Z = -X.*exp(-X.*Y) + cos(X); surf(X,Y,Z,'FaceAlpha',0.75) f = @(x,y) log(1+x.^2+y.^2) - (x-1).^2 ...

7 hours ago | 0

How to export a cell matrix into a MS Excel file
filename = 'test_THRESH_DATA.xlsx'; N = size(THRESH_DATA,1); for ii = 1:N T = table(THRESH_DATA{ii,:}); writetable...

8 hours ago | 1

| accepted

When I export results to a text file or csv etc, it is written in only one line, how do I make that it appear in columns?
T=table(sigma(:),x(:),res(:),dist(:),k(:),p(:), ... 'VariableNames',{'sigma','x','res','dist','k','p'}); csvFile = 'tabl...

1 day ago | 2

| accepted

Matrix dimensions do not match
From pcolor documentation: "pcolor(X,Y,C) specifies the x- and y-coordinates for the vertices. The size of C must match the siz...

1 day ago | 0

CVX function Error -

1 day ago | 0

How do I put all my vectors through the same operation?
l = 0.50e-3;%m% % store the vectors Tf1, Tr1, Tf2, ..., Tr9, in a 9x2 cell array % (so that, e.g., what you called Tf6 is no...

1 day ago | 0

i wanna animate 2 subplots in the same time and each one for different numbers.
% Animation figure NN = numel(Solution); ax = gobjects(1,NN); hh = gobjects(1,NN); for ii = 1:NN ax(ii) = subplot(NN,1...

1 day ago | 0

| accepted

Assigning letters to numbers
alphabets = [' ', 'A':'Z']; Map(alphabets) = 0:numel(alphabets)-1;

2 days ago | 0

| accepted

Index a Y = MxN, with X=Mx5 (where elements in X are column IDs for values to extract from Y)
You can use sub2ind for that. https://www.mathworks.com/help/matlab/ref/sub2ind.html Example: Y = randi(50,6,10) Z = Y/100; ...

2 days ago | 1

| accepted

read csv file and output csv file
You are overwriting k inside the k for-loop: for k = 1:numel(files) filename = fullfile(files(k).folder,files(k).name); ...

3 days ago | 1

I am getting "Array indices must be positive integers or logical values" in my code.
You have created a variable called "factorial", the existence of which prevents you from using the "factorial" function. Run c...

4 days ago | 2

| accepted

Plot multiple cases from data structure at once?
For each participant, load the participant's mat file and plot the EDA data into the next tile of a tiledlayout. % number of pa...

4 days ago | 0

how to find where a value falls in a list
A = [ 1 0 2 0.053 3 0.105 4 0.157 5 0.208 6 0.258 7 0.306 8 0.353 9 0.399 10 0...

4 days ago | 0

| accepted

"Assigning to 2 elements using a simple assignment statement is not supported. Consider using comma-separated list assignment." Error only sometimes happens.
If you have two y-axes, then ax.YAxis is non-scalar, so ax.YAxis.LineWidth = 1.5; gives you an error. Notice that the previou...

5 days ago | 0

Inconsistancy of colorbars across contourf() plots
Use clim() instead of setting the y-limits of the colorbars. https://www.mathworks.com/help/matlab/ref/clim.html X = 1:10; Y ...

5 days ago | 0

| accepted

Concatenating a signal given its segments' limits
ww = [ 10 15 16 22 33 44 45 50 51 60 70 80 ]; N = 1; to_keep = ww(2:end...

6 days ago | 1

| accepted

griddedInterpolant error "Interpolation requires at least two sample points for each grid dimension."
The points (bp1, bp2, bp3) in 3d space do not form a grid. They are equally-spaced points along a line segment from (0,5,2) to (...

7 days ago | 0

export excel from Matlab compiler
The code looks like it will work the same in a compiled executable as it does in (uncompiled) MATLAB. The difference is that th...

7 days ago | 0

On line 53: error = abs(-15 - Theta(i)); . I'm getting an error that says, "Index exceeds the number of array elements. Index must not exceed 17901". what am I doing wrong?
First, let me run the code almost up to where the error happens: clc clear all %Given: M1 = 3; G = 1.4; tot = 180; Theta=...

7 days ago | 0

create empty pie chart (or not generate the graph)
Maybe something like this: matrix_new = []; figure if isempty(matrix_new) % matrix_new is empty: create the circle ...

7 days ago | 0

How to change bacground color of uitreenode?
% remove any existing uistyles from the uitree: removeStyle(app.Tree) % create a new uistyle for Blue Background: s = uisty...

7 days ago | 0

| accepted

Resolution of plot code errors
Use fplot instead of plot: syms x; y=1/sqrt((1-x^2)^2+(2*x)^2); fplot(x,y); xlim([0 5]); ylim([0 4]);

7 days ago | 0

Why does UIaxes handle is deleted when calling a function and taking inputs as UIaxes handle in MATLAB webapp ?
copyUIAxes called with one input creates a new figure, as the comment near the top of copyUIAxes.m states: % COPYUIAXES(uiax) c...

8 days ago | 0

How to Shade area between 3 curves each with different x-axis values?
I guess you want to shade the area between the lowest curve and the highest curve for all x. T = readtable('Book1.xlsx') % c...

10 days ago | 1

| accepted