Réponse apportée
Make changes to a text file with numbers and text
str = fileread('hector_400km.txt'); lines = regexp(str, '\r\n|\r|\n', 'split'); for line = 20 : length(lines) modifiedD...

environ 3 ans il y a | 0

Réponse apportée
trivial matrix question: how to rearrange matrices in a given order
A = reshape(1:3^3,3^2,[]) B = permute(reshape(A',[],3,3),[2,1,3]) A = reshape(B,[],3)

environ 3 ans il y a | 1

Réponse apportée
Non linear fit of y=f[x] where y can have multiple values for a single value of x
You can't fit this because bijective mapping is required between x and y. Maybe this can hekp with your task. x = [1,2,3,2,4,6...

environ 3 ans il y a | 0

Réponse apportée
Switching between two integrators, spacecsaft dynamics
I highly discoruage you to switch between dynamical systems because you are making your life much harder for no reason. First, ...

environ 3 ans il y a | 0

Réponse apportée
Creating a rectangular patch using random numbers
You can't really fix this. A plane is univoquely defined by 3 points in space, so, most-probably, a fourth point won't lie on t...

environ 3 ans il y a | 1

Réponse apportée
How to find how many values in one column in csv file?
Once you upload the data from you .csv you can find start and end indeces by doing: data = randi(2,1e3,1) - 1; startIdx = strf...

environ 3 ans il y a | 0

Réponse apportée
Polarplot - plot arc between points instead of line
point1 = [3, 4]; point2 = [10, 0]; radius = 6; dir = 'Up'; nPoints = 50; [x, y, c] = getArc(point1, point2, radius, dir, ...

environ 3 ans il y a | 0

Réponse apportée
I am using surf command inside time loop. And I want my initial reference surface.
To plot multiple object you want to use: hold on; If you ant to iterate different plot but only retain the first one, the me...

environ 3 ans il y a | 0

Réponse apportée
How to define color axis in a for loop?
By axis color, do you mean something like this? nPoints = 10; [X,Y] = meshgrid(-3:6/nPoints:3,-3:6/nPoints:3); Z = peaks(X,Y)...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Trying to simultaneously solve the following, but I'm getting the following error, can someone please tell me how to fix it?
Try this syntax: syms F G eqn = [2 * F^2 * G^2 + 3 * G == 13.8 , 2 * G^3 + F^2 == 16.6]; sol = solve(eqn, [F G]) If you re...

environ 3 ans il y a | 0

Réponse apportée
How can I graph a cylindrical magnetic dipole?
With quiver or quiver3 [Ref].

environ 3 ans il y a | 0

Réponse apportée
Convert Matlab Cell-Array with subtables into a python variable type
I do not know specifically how to pass data from Matlab to Python, but my way of doing it would be to store the cell in Excell s...

environ 3 ans il y a | 0

Réponse apportée
"Maximum recursion limit of 500 reached." when loading model in Simulink
set(0,'RecursionLimit',1000);

environ 3 ans il y a | 0

| A accepté

Réponse apportée
How do you get a function to return true or false to the script where the function was called?
the file play_blackjack.m is not a script, but a function. In blackjack.m change the line: play_blackjack To: game = play_bl...

environ 3 ans il y a | 1

Réponse apportée
Why does the heatmap chart color some numeric values differently?
>> h = heatmap(tbl,'Smoker','SelfAssessedHealthStatus','CellLabelColor','Black'); % ...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
How to shade with upper and lower limits along a curve line? (see example in image below)
N = 100; x = linspace(0,2*pi,N); y = 1 + cos(x); yNoiseUp = y + 0.5 + .25*(sin(x) + .25*(rand(1,N) - 0.5)); yNoiseDown = y -...

environ 3 ans il y a | 0

Réponse apportée
How to create string of text-objects
You can't concatenate doubles and string in one array, because the array can be only one of them. If you want to only store the...

environ 3 ans il y a | 1

Réponse apportée
Chain array indexing error to access elements of a function
The fact that you can't concatenate indexing is a well-known Matlab limitation whose implementation has already been suggested o...

environ 3 ans il y a | 0

A résolu


Armstrong Number
Write a function name armstrong_check that checks whether the given input is an Armstrong Number or not. It returns logical True...

environ 3 ans il y a

A résolu


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

environ 3 ans il y a

Réponse apportée
How can I make my lamp indicator color turn green once it reaches a certain number with the app.label.Text
uilabel dont allow much interactivity. I guess you have some familiarity with Callbacks, so I suggest you to use uieditfield an...

environ 3 ans il y a | 0

Réponse apportée
Combine Plot and Scatter in Legend
x = 1:10; y1 = randi(10,1,10); y2 = randi(10,1,10); y3 = randi(10,1,10); figure; hold on; grid on; plot(x,y1,':d',... ...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Graphical output of subscripts in one main script
Your code is fine but you need to delete the first line: clc, clear, close all I did it and saved your script naming it fig_4....

environ 3 ans il y a | 0

A résolu


Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

environ 3 ans il y a

Réponse apportée
Looping for cell arrays
Add a second loop for the rows: for row = 1 : size(down_files,1) for col = 1 : size(down_files,2) fileread(down_f...

environ 3 ans il y a | 1

Réponse apportée
Help with matlab script
1) Correct me if I am wrong, but with "I'm not seeing the values appear in the workspace", I think you are saying you only see t...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
I am getting the following error: Error using atan2 Inputs must be real. Error in (line 27) phi_vet = 2*atan2(-k_1-sqrt(k_1.^2+k_2.^2-k_3.2),k_3-k_2);
The term inside the square roort has some negative values, thus producing imaginary numbers. sqrt(k_1.^2+k_2.^2-k_3.^2) I am...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Hyperbolic Fitting using multiple data sets from each experiment.
Please try to use the forum next time, as your answer was just a simple search away. data = readmatrix('Model.xlsx'); x = da...

environ 3 ans il y a | 0

Réponse apportée
Finding correct MinPeakDistance using for loop
Your idea of increasing 'MinPeakDistance' to adjust the peaks found is not consistent. For example, if you iterate manually, yo...

environ 3 ans il y a | 0

Réponse apportée
fill and replicate numbers in the matrix
You can re-adapt your data to exploit this very nice method to divide stimuli into a cell array. Then is just a metter of manip...

environ 3 ans il y a | 0

| A accepté

Charger plus