Réponse apportée
Index of value when you want to check multiple elements at the same time between 2 cell arrays
If I understand the quesiton, you want to find indices in A where the values in B are found when they are in A. You can use ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How can I generate random varaible from 0 to 1 without including 0?
The rand function generates randum numbers between 0 and 1, not including 0 or 1: https://www.mathworks.com/help/matlab/ref/ran...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Can I Use the matlab in the mobile phone or tablet rather than laptop?
Yes there's information about MATLAB mobile here: https://www.mathworks.com/products/matlab-mobile.html It's pretty difficult t...

plus de 4 ans il y a | 0

Réponse apportée
semilogy, loglog do not work in order to set the y axis on a logarithmic scale
When you use the log plotting functions they don't change the axis scale if hold is on. There's a note all the way at the bottom...

plus de 4 ans il y a | 1

Réponse apportée
How to plot a matrix containing NaN?
pcolor specifies color at the vertex, which (confusingly) means that you have one less row and column. It does great with NaN th...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
How do I combine my function's output matrices into a single matrix?
Your function loops over some values and for each one computes a row vector. To store the row vector in a matrix, specify an i...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How to compute a vector
Here's how I'd break this down. First, let's have a look at what the syntax produced for X: X=[1,2,3;4,5,6] So X is a matrix...

plus de 4 ans il y a | 1

Réponse apportée
Stacked plot /waterfall plots to visulaise figures
If you want to put these data into a waterfall, you can do waterfall(e') but that won't get your time axis correct. Using meshgr...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
How to plot readed audio files in multiple plots or subplots by MATLAB
It looks like you're as far as getting the filenames, but need to read the data and make the plots. audioread works well for ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Array indices must be positive integers or logical values.
It looks like when you gave findpeaks a sampling rate it converted the units to time: From the findpeaks documentation page: [...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How can I specifiy the colors when using the group by color option in boxchart?
BoxChart will use the colors in the active 'colororder', you can change which index they use with SeriesIndex but I'd recommend ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How change 3D plot shape?
The mesh function is good for this in general. Getting the camera angle just right can be tricky, sometimes you can get there ...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
converting a binary string into double using commas for separation
How about something like this? k='00101101011010101101101111101110111100000001010000110010011000101111000101001010' str2doub...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
How to create a heatmap from recorded positions
I'm not sure if you're asking about collapsing the trajectories to a single value per ship, or just displaying a binned version ...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
Error in converting array in double to string
it's pretty confusing, but when you made str you made it as a double array. str = []; class(str) So when you assign somethin...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How to change font type of bar plot labels?
You can set the X Axis Tick Label Interpreter (wow a mouthful!) as follows: ax.XAxis.TickLabelInterpreter='latex' where ax is ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How to add zeros to the end of a column vector
You can use padarray for this (or you can just do [b; zeros(numel(a)-numel(b),1)]) a = (1:9)' b = (1:5)' c=padarray(b,numel(a...

plus de 4 ans il y a | 0

Réponse apportée
How efficient is it to use (end+1) to add a value to an array?
Preallocating an array is far more efficient. Why? Check out this page: https://www.mathworks.com/help/matlab/matlab_prog/prea...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
repeated value of a vector
repelem is perfect for this kind of problem: x = [1 5 15 2] repelem(x,2)

plus de 4 ans il y a | 1

Réponse apportée
How to set x-axis into HH:MM format?
The B that you list in your snippet doesn't look like times. Here's an example where B is actually a time: A = [24 25 26 27 2...

plus de 4 ans il y a | 0

Réponse apportée
[beginner] How do you plot two vectors of diffrent length?
At some level the question is what you expect from the plot. When I look at your y1 vector, I notice that it's got an odd ar...

plus de 4 ans il y a | 0

Réponse apportée
Hold on issue for subplots
TLDR: use tiledlayout/nexttile if you have R2019b or later, on older releases you can work around subplot's save/load weirdness ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Variable not assigned during call to function
I would think your nested function would return a value (which can be the same as the main function if you like). Nested functio...

plus de 4 ans il y a | 1

Réponse apportée
Logic in fibonacci series
You can imagine a for loop as running the contained code for each of the values that it's iterating over. Below, I've unpacked y...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
How can I save the figures in the subfolder of current directory path?
Your code is failing because you're pasting in the string 'path' instead of the variable path. I wouldn't recommend using try +...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
Combine time related columns into timestamp for data in csv
The datestr is perhaps adding confusion? This page has some good information on how to format datetimes: https://www.mathworks....

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
join a specific column from csv 2 to csv 1
Assuming your CSV files are shaped appropriately, you probably want: C = [A B(:,2)] B(2) refers to the second element in B, ...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
How can use randi function for a specific array of numbers?
How about using randi to pick indices into dataSet? Alternatively, if you're not constrained to use randi, just use randsample...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
How to create a new matrix from an function performed on another matrix?
Many functions in MATLAB will just accept a matrix: V=[1+0i; 3+4i; 2+3i; 0; 4+3i]; Theta = rad2deg(angle(V))

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Saving image in full screen with TiledLayout
Could you set the figure position to be fullscreen, and keep the tiledlayout at the default (which occupies the full figure wind...

plus de 4 ans il y a | 0

Charger plus