Réponse apportée
How to draw a vertical line at certain x values on a plot
hold on; plot([x x], ylim) Or better yet, in case you have multiple sets of axes: % if ax is the set of axes you are plotting...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
How to make this pie chart?
One option: p = pie(ones(1,5)); % create a pie chart with 5 equal slices t = p(2:2:end); % get the handles to the text labels ...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
Find min value in one column based on repeated value from another column
If your original table is T, I believe this should work: T2 = table; [G,T2.Location] = findgroups(T.Location); T2.Min = split...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
How can I store the data entered by edit button on GUI?
How about something like this? f=figure(... 'DockControls','off',... 'unit','pixels',... 'MenuBar','none',... ...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Plotting a function not working
One possible explanation: b=cos(omega*t*phi); c=cos(phi)*exp(-t*R/L); In these lines you use t, which is your upper bound on ...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
how to re-insert elements into a vector
How about simply W = filloutliers(W, 'linear'); If you want to supply the outliers yourself: outliers = [5785; 7934]; x = 1:...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
Comparing rows of a table
Let me know if this works: [~,i] = min(1-[TEST.model1_CC, TEST.model2_CC, TEST.model3_CC],[],2); [~,i2] = min([TEST.model1_RMS...

presque 6 ans il y a | 1

| A accepté

A résolu


Test for balanced parentheses
Given the input inStr, give the boolean output out indicating whether all the parentheses are balanced. Examples: * If ...

presque 6 ans il y a

A résolu


DNA N-Gram Distribution
Given a string s and a number n, find the most frequently occurring n-gram in the string, where the n-grams can begin at any poi...

presque 6 ans il y a

A résolu


Implement a ROT13 cipher
Replace each character in string s1 with the character that is shifted 13 positions from it (wrap back to the beginning if neces...

presque 6 ans il y a

A résolu


Clean the List of Names
Given a list of names in a cell array, remove any duplications that result from different capitalizations of the same string. So...

presque 6 ans il y a

A résolu


De-dupe
Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if a =...

presque 6 ans il y a

Réponse apportée
find coordinates in a 3D surface
Don, Below is interp2 in action using your example. V contains the Z values of the surface at each x and y coordinate given by ...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
How to create diagonal block matrix
How about this? >> blkdiag(reshape(1:9,3,3)', [1,2;4,5], [1,2;4,5], 1, 1) ans = 1 2 3 0 0 0 ...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
Custom error messages with Class Object
Have a look at subsref and subsasgn. https://www.mathworks.com/help/matlab/matlab_oop/indexed-reference-and-assignment.html#br0...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
My for loop is only retaining values of the last iteration. How do I keep my variables stored in a vector?
The error your code gives me is: Error using fullfile (line 67) All inputs must be strings, character vectors, or cell arrays ...

presque 6 ans il y a | 1

Réponse apportée
Show values depending on values in another column above the actual row
A few possibilities: If you don't care about the order of the rows changing: T = sortrows(T, {'Day', 'Name'}); N = sum(T.Day=...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
How to use function handle for "defavl" function when it is used with "fzero" function?
In the example you gave, the first argument to fzero must be a function which takes a scalar and returns a scalar. In your examp...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
I wrote this code and got this error (The function "FinalCost" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.)
When you call FinalCost here: %calling finalCost to calculate the finalcost and the optimal values %for x and y for th...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
How to check and convert a column of strings to numbers
(2) Convert any string to a double using str2double. "If str2double cannot convert text to a number, then it returns a NaN value...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Display the Letter, Count, and Frequency for the vowels in a file
From the reference page for open: "A = open(name) returns a structure if name is a MAT-file, or it returns a figure handle if n...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
Undefined operand in function_handle
Where you call phi_i or B_j within the definition of H, you need to supply the arguments ii and m. For example, ..(pi/2-phi_i)....

presque 6 ans il y a | 1

Réponse apportée
Print out a one column array
The extra columns may be left over from running ave = (PTS/G) If you clear your workspace, they should go away. However, if yo...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
How to Integrate Lognormal PDF multiplied by a function.
The error (Matrix dimensions must agree) occurs because your t is an array of length 3503185 and the V passed into Dp() by integ...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Error using writematrix (line 134) Invalid parameter name: Range.
The parameter 'Range' is only valid when writing to a spreadsheet file. Per the documentation: "The following standard file ext...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
How to make this code store different names and output them in their respective places.
This isn't perfect, but hopefully it helps you get where you're going: r_team = {}; r_count = 0; s_team = {}; s_count = 0; ...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Can matlab assign a vector of objects?
One possibility... C = num2cell([1 2 3]); [x,y,z] = C{:};

presque 6 ans il y a | 1

Réponse apportée
Replacing values in a matrix
Try this: N = 1500000; X = randi([0,1],[N,6]); i = 1:N/10; X(:,1) = repelem(i,10);

presque 6 ans il y a | 0

| A accepté

Réponse apportée
operations in a row only on certain elements
See if this works: idx(b) = true; A(1,~idx) = 0;

presque 6 ans il y a | 0

| A accepté

Réponse apportée
How to call out the original name of a value from an array?
This gives the maximum value among rows 3, 5, and 7, as well as the row and column of that value within T_d: maximum = max(max(...

presque 6 ans il y a | 0

Charger plus