Réponse apportée
Is there a way to find the mean of every other number in a vector and compare it to every other number in another vector?
I'm not sure if I am clear on what you are trying to do but from your description I would do something like this: red = [2 4 3 ...

plus de 4 ans il y a | 1

Réponse apportée
Trying to combine multiple square matrices diagonally into a combined larger matrix
You can use MATLAB's blkdiag function for this so in your case T = blkdiag(A,B,C)

plus de 4 ans il y a | 0

Réponse apportée
intersect() returns unplausible values
I think you may be misunderstanding the usage of MATLAB's intersect function. It finds the set intersection (elements in common)...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
how can i get value of y
It looks like you are trying to solve for the root of a nonlinear function. You can use MATLAB's fzero to do this. Type doc fzer...

plus de 4 ans il y a | 1

Réponse apportée
If point x belongs to vertices of rectangle?
You could define a 4 by 2 array, corners, with the corner values (first column x values, second column y values) then do somethi...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How to solve this error : "index out of bounds because numel(U)=1"
With your definition of U, U has only one element. Note you first assign a scalar (one element) variable u=1, then you assign U ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
3 Excel COLUMNS x,y,z imported into work space as vectors, z is a function of x,y how do i get the data into a 2d lookup table
Here is an example MATLAB script that you could run to assign the necessary variables in your base workspace before running yo...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How to adjust axes created using plot
use the ylim command for example g = @(x) sin(x)/x fplot(g, [-10, 10]) title('The result of fplot') ylim([-2,2])

plus de 4 ans il y a | 1

Réponse apportée
How to read an image & convert it into an array and vice versa
You can use MATLAB's imread and imwrite functions for this. On the command line you can type doc imread to get documentation fo...

plus de 4 ans il y a | 0

Réponse apportée
How to select corresponding rows of a table based on selected rows of one column?
T = readtable('sadegh.geo_cod.xlsx'); % sort the rows of table in descending order of areas Tsrt = sortrows(T,'Area1','desce...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Remove successive rows from a table where a specific column value is duplicated
If I am understanding correctly I think this will do what you are asking T = readtable('Metingen-data-2021-11-17 10_48_18.csv')...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Using a string in an if statement to print data from excel.
put single or double quotes around yes if view_data == 'yes' and also around no in the following line

plus de 4 ans il y a | 0

Réponse apportée
Why do I have "Warning: Imaginary parts of complex X and/or Y arguments ignored."
Most likely you are trying to raise a negative value to a fractional power, for example x^0.5 or x^0.4 where x is negative. Thi...

plus de 4 ans il y a | 0

Réponse apportée
Simulink build a loop and define intial conditions
In general you should be able to run your simulation iteratively by starting the simulation programatically using the MATLAB sim...

plus de 4 ans il y a | 0

Réponse apportée
How to plot stair like this??
I think this does what you want and is nice and simple X = [95 0;onlyPlot] stairs(flip(X(:,2)),flip(X(:,1)),'-o')

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Cant get for loop to run
It looks like you define f to be a scalar at the top of your script. So it doesn't make sense to iterate through values of f(n) ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How do you take the absolute value of only the complex number?
x = -0.0115+0.0059i xnew = real(x) + abs(imag(x))*i

plus de 4 ans il y a | 0

Réponse apportée
How do I set a starting point in a find function
If you know you wanted to start the search at a known row and column index you could use iStart = 2 jStart = 3 [a,b] = find(A...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
Ignore zero values when searching for minimum value in column of matrix
idl = cANALY(:,1)>0 % use logical indexing [tnValueAnaly, tnRowAnaly] = min(cANALY(idl,1));

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Animated 2D ball trajectory with images
You can plot a filled circle (or an approximation of one) by plotting filled polygons using the fill command. For example to pl...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How to import data from excel and multiply a specific extracted column?
Hi, The problem is that you are reading the variables into tables, not vectors. You can't multiply a scalar value times a tabl...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
MATLAB returns a wrong value of determinant.
There will always be some tolerance in numerical methods compared with exact solutions. 3.88858e-15 is considered very small, an...

plus de 4 ans il y a | 0

Réponse apportée
Find sequence of numbers in vector
Rather than using strings you can check a condition involving the numerical value of the elements in a, something like if a(k) ...

plus de 4 ans il y a | 0

Réponse apportée
How do I get the average of a signal over every certain time duration (simulink)?
So I'm assuming you are looking for an output signal that has a sampling period of 0.1 seconds, which gives the average value of...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
intersect between the second column of cell array A (for all rows) and the first column of cell array B (for all rows)
The problem is that A{:,2} and B{:,1} are not returning arrays but instead multiple answers. So somthing like this: >> A = {1,2...

plus de 4 ans il y a | 0

Réponse apportée
Replace array elements with strings
In the example code below I show how to do it with 4 names, but you can expand it to however many names you have. names = {'Pis...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Output of loop is 2x1 vector
If you want to store the results of each loop in a 2 by numSteps matrix you can do this numSteps= 10000; %k steps c = 0.000001...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How to add some fluctuation in the flat line?
I think you can adapt the approach that I illustrate here: % generate original function with flat zone t = linspace(1970,1880)...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Concatenate tables with variable data types in columns
I think part of the problem is the NAN's in your files. They don't automatically get imported as MATLAB NaN's as you hope. It ju...

plus de 4 ans il y a | 0

Réponse apportée
Simulink: changing parameter mid-simulation
I would just run one simulation for 5 seconds and put in a switch as shown in the first example below. Note you could probably m...

plus de 4 ans il y a | 0

| A accepté

Charger plus