Answered
Unrecognized function or variable
This is correct: TF = contains({files_in_folder.name}, app.SelectTestID.Value); And the reason you get the error that VideoFil...

4 years ago | 1

Answered
I wanna do the plot exactly the same as the attached picture, my Y axis should start from 0.0001. and i need to draw this red dashed line from the end of plot point to x axis
How about this? Theta_x = readmatrix('Theta_x.txt'); POE_Y = readmatrix('POE_Y.txt'); plot(Theta_x,POE_Y) hold on plot([m...

4 years ago | 1

| accepted

Answered
How to plot a function within a for loop?
You're plotting one point at a time there, which won't appear unless you use a data marker. And even then you'll only see the la...

4 years ago | 1

| accepted

Answered
have to plot the number of head in a game of head or tails that the token is trowed N times, but my plot dont work
% caras = cara + 1; cara = cara + 1; That will get the total number of heads (a.k.a. faces) to be correct, but you'll still be...

4 years ago | 0

| accepted

Answered
How to tick the parameter in the plot of a parametric function?
t = linspace(0, 1, 1000); x = t.^2; y = t.^3; tick_length = 0.04; t_tick = linspace(0,1,21); x_tick = t_tick.^2; y_tick...

4 years ago | 2

| accepted

Answered
Plotting a sinusoidal wave.
https://www.mathworks.com/matlabcentral/answers/1769250-how-can-i-generate-a-sinusoidal-wave-in-matlab-in-one-plot

4 years ago | 0

Answered
Matlab keeps giving me error for invalid syntax! I don't understand why
Missing comma: % fprintf('Le soluzioni distinte sono %12.2f \n' A1, A2) % ^ ...

4 years ago | 1

| accepted

Answered
How to find the maximum value of C that corresponds to a set of X,Y coordinates?
X = 1:3:31; Y = 1:2:13; C = rand(numel(Y),numel(X)); imagesc(X,Y,10*log10(C)) [maxC,idx] = max(C(:)) [yidx,xidx] = ind2su...

4 years ago | 1

Answered
how to compare two consecutive values in a matrix
temp=[1,2,2,1;3,4,4,3;5,6,6,5;7,8,8,7] In each row, you have one fewer comparisons than you have elements, so M is of size one ...

4 years ago | 0

| accepted

Answered
How to make inset figure with two y-axes
Seems to be ok: % initial plot plot(rand(1,10),rand(1,10)) % make the inset axes('Position',[0.4,0.7,0.2,0.2]) box on ...

4 years ago | 0

| accepted

Answered
Mean of a field of a struct containing arrays
% First, to approximate your struct array, I create a % 3x1 struct array S, with a field 'crop', each of % which is a 206x15...

4 years ago | 1

| accepted

Answered
How to change change color of line or patch in legend
The problem: the first patch is used as a legend entry: figure() hold on patch() plot([0 1]) patch() plot([1 0]) hold off...

4 years ago | 0

Answered
Creating a stacked bar plot with a non-unique x-axis.
Does this work? x = [2, 3, 6, 9, 2, 6, 2, 5, 4]; y = [4, 2, 3, 1, 3, 2, 5, 2, 5]; xx = min(x):max(x); nxx = numel(xx); co...

4 years ago | 0

| accepted

Answered
How can I generate a sinusoidal wave in Matlab in one plot?
t_start = 0; t_end = 1; t_step = 0.002; % 0.002 looks more like a sinusoid than 0.02, but do what you like f = 20; t = lin...

4 years ago | 0

| accepted

Answered
stringcmp filenames with similar naming
"Is there a good way to match files from different folders together?" Here's an approach using dir, fullfile, fileparts, strcat...

4 years ago | 0

Answered
How do i delete the spaces that are in the middle of a string array?
To delete elements from an array, set them to [] (or ''). % to removes spaces (' '): str=' 123 456 '; str(str == ' ') =...

4 years ago | 1

Answered
How to build a loop through every column and row of a cell
% first, I create a 32x3 cell array of random 10x10 matrices C = arrayfun(@(x)randn(10),zeros(32,3),'uni',false) % now loop th...

4 years ago | 0

| accepted

Answered
why my 6th graph is horizontal lines? in the 'Martin_CompareElectricCar' Very urgent!!
Each "Remaining Battery Energy" is on a different scale: % ~100 Daniel_ElectricCar % ~82-84 Martin_ElectricCar1 % ~20-22 M...

4 years ago | 0

| accepted

Answered
I want to generate the series [2,3, 6,7, 10,11,.....] i.e plotting first two consecutive numbers and ignoring nest two consecutive numbers and so on... any idea?
n_start = 2; n_end = 100; One way: n = n_start:n_end; n(3:4:end) = []; n(3:3:end) = []; n Another way: n = reshape((n_...

4 years ago | 0

Answered
How to generate plot
Original code (with disps removed): K1 = 0; a = 5; n = 30; P0 = 100; c = 3; for i = 1:30 s = cos(((2*i-1)*pi)/(2*n));...

4 years ago | 1

| accepted

Answered
Project 3D plot to 2D automatically
If I understand what you want to do, you can use view(2) (or more generally, i.e., if it's not always going to be the x-y plane,...

4 years ago | 0

Answered
loop matrix to new matrix
A=[60 56 44 44 22 18 22 18; 60 56 44 40 8 8 8 8;56 44 12 12 8 4 8 12]; Here's one way to write the loop you want: % initialize...

4 years ago | 0

| accepted

Answered
How to set grid space in plot ?
What's the problem with yticks(0:5:Max+10)? DisplayNumber(0:9,100*rand(1,10),100*rand(1,10),'output.pdf','') function DisplayN...

4 years ago | 0

Answered
Store one vector range inside another
RES_BLOCK_C = X(385:1921,1);

4 years ago | 0

Answered
Error:Unable to perform assignment because the size of the left side is 30-by-1 and the size of the right side is 59-by-1. what going wrong with code?
I imagine the error happens on this line: under_2(:,1)= nonzeros(under(:,1)); and is caused by under and under_2 containing va...

4 years ago | 1

Answered
How to set the grid line of y-axis by 5 ?
Maybe something like this? ax = gca(); set(ax, ... 'XLim',[0.7 4.5], ... 'YLim',[0 40], ... 'XTick',1:4, ... ...

4 years ago | 0

Answered
How to make a user interface using function.m
Here is some code you can run, refer to, and possibly use for your purpose. I wasn't sure how many inputs your functions take o...

4 years ago | 0

| accepted

Answered
define all data of the row data based on one element of this row form huge array
% also store the index where the maximum occurs: [best_result,idx] = max(Output) % use that index to get the row of Input ...

4 years ago | 0

| accepted

Answered
Need Row data after ismember or using strcmp (compare only single column A and later need all Row data of that particular column)
Here is something that will read the given "data" sheets (in this case 'MissingData' and 'NewlyAddedData'), separate their conte...

4 years ago | 0

Answered
Error using trapz. Point spacing must be a scalar specifying uniform spacing or a vector of x-coordinates for each data point.
When X and Y are the same length X = 0:0.01:1; Y = rand(1,101); trapz works trapz(X,Y) But when X and Y are not the same le...

4 years ago | 1

| accepted

Load more