Réponse apportée
How can I plot a string function?
Is this the "string function" ? StrFunc = 'x.^2+2*b+c'; %Converting to a function handle Letters = unique(regexp(St...

environ 8 ans il y a | 0

Réponse apportée
Maximizing code interpretability while minimizing computational cost.
The debate of code readability vs performance has been going on for a long time. Your #5 is probably the best choice : document ...

environ 8 ans il y a | 1

| A accepté

Réponse apportée
Recursive function not stopping
Is this what you want to do? % % x = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; ...

environ 8 ans il y a | 0

Réponse apportée
How to call a function inside a parfor?
1. |phi| does not know what yraw and Vinv are. To fix, do this: function [obj grad] = phi(y, yraw, Vinv) %Pass yraw and Vi...

environ 8 ans il y a | 1

| A accepté

Réponse apportée
Suggestions for a laptop?
# Search for "best laptop for programming" or "best portable laptop" on the search engine. # Make sure computer meets Matlab mi...

environ 8 ans il y a | 1

Réponse apportée
Calculate mean of certain row
Data = randi(10, 9, 2); %Your 9x2 matrix Means = zeros(3, 2); %Your output for j = 1:3 Means(j, :) = mean(Data...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
Problem with "roots" command
Root = roots(...) %Not saving output correctly here This will override the value of Root every iteration, resulting in a 3x...

environ 8 ans il y a | 1

| A accepté

Réponse apportée
Can i make a personalized license warning message?
You could place a startup.m file in the matlab |path| or the |userpath| (ex: 'C:\Users\usr121\Documents\MATLAB\startup.m'). The ...

environ 8 ans il y a | 1

Réponse apportée
Adding a random value (-0.1 : 0.1) to scatterplot data points to prevent exact overlapping.
Try this example to see how to adjust X and Y values by a random value between -0.1 to 0.1 only if (x,y) are duplicates. X...

environ 8 ans il y a | 1

Réponse apportée
Explain how re-calling several user-defined-functions work much faster than the first call? And how should I ensure this happening everytime?
This might work. Use |memoize| to store a cache of the function call results. The first summon is slow, the 2nd summon is faster...

environ 8 ans il y a | 0

Réponse apportée
Cannot get textscan() while loop to work
FID = fopen('X-MinutalXX.csv'); Data = textscan(FID, '%s%{MM/dd/yyy HH:mm:ss.SSS}D%f%f%f', 'Delimiter', ';', 'Headerlines',...

environ 8 ans il y a | 0

Réponse apportée
Plot only for positive y
NEW ANSWER ylim([0 inf]) %Will automatically compute the limit where "inf" is used OLD ANSWER ylim([0, max([y(:); ...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
Function 'subsindex' is not defined for values of class 'datetime'.
FID = fopen('test.csv'); Data = textscan(FID, '%D%f', 'Delimiter', ',', 'Headerlines', 1); fclose(FID); Data{1}.Yea...

environ 8 ans il y a | 0

Réponse apportée
how to make a variable execute only once ?
Or you could make a class of type handle that stores the value of t. Every time you summon the method |getStr|, it'll return the...

environ 8 ans il y a | 0

Réponse apportée
How can I simplify/vectorize this nested loop version of pascals triangle?
Behold, a function called |pascal| <https://www.mathworks.com/help/matlab/ref/pascal.html> S = pascal(n)

environ 8 ans il y a | 0

| A accepté

Réponse apportée
Can a parfor loop be restarted?
Perhaps you can save the input variables used for your |runfunction| into a separate cell array. Try this for example: Erro...

environ 8 ans il y a | 0

Réponse apportée
How to use parfor
Are you trying to flip the matrix along the 2nd dimension? original = flip(original, 2) Can't do parfor in your case bec...

environ 8 ans il y a | 1

Réponse apportée
mex script and how to show output from another function which is using vprintf()
Instead of using |vprintf|, try using |mexPrintf| <https://www.mathworks.com/help/matlab/apiref/mexprintf.html>

environ 8 ans il y a | 2

| A accepté

Réponse apportée
msgbox does not show title
Your "Results" text isn't showing because the window is too small. Try making it wider as such: angle = 30; true_vector_...

environ 8 ans il y a | 2

| A accepté

Réponse apportée
Viewing multi level structures in the the Workspace
You could use this recursive function to display the variable stored in the Nth level of a structure. This is a starting templat...

environ 8 ans il y a | 1

Réponse apportée
please, I have 5 axes in matlab gui and when i plot in axes1 he can't grid. i used grid or grid on after plot but anything in result . my script :
Instead of doing a generic |grid on| on the current axes, specify the axes. grid(handles.axes1, 'on') grid(handles.axes2...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
fastaread fails when the header contains a comma
Try this one: |readFasta.m| (attached). Had to create another fasta reader due to the issues you're describing when using fastar...

environ 8 ans il y a | 1

Réponse apportée
A question about moving dot. please help.
Not sure if it's an assignment, but here are more hints to achieve that: # Use |zeros(M, N)| to make a zero image of size MxN...

environ 8 ans il y a | 0

Réponse apportée
Can I run unit tests in the MCR?
Instead of using the Application Compiler, use |mcc|. It'll give you a command window that opens up with the GUI. But the downsi...

environ 8 ans il y a | 0

Réponse apportée
Use Compiler to Deploy Code on Remote Unix Machine
To compile the code, use |mcc| in MATLAB. It'll include your fcn.m file IF that file is in the MATLAB path. >> mcc -m main.m...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
I'm getting webcam error in the following code, kindly hep me figure out the bug in code?
Without the error message, can't pinpoint the exact issues. But here are some guidelines and other issues. Check to make sure...

environ 8 ans il y a | 0

Réponse apportée
how to save a plot without Margin of figure?
This might help: <https://www.mathworks.com/help/matlab/creating_plots/save-figure-with-minimal-white-space.html> Modify the...

environ 8 ans il y a | 4

Réponse apportée
How to repeat array with
A = 1:4; E = [A(1) repelem(A(2:end), 2) A(1)]; E = 1 2 2 3 3 4 4 1

environ 8 ans il y a | 0

| A accepté

Réponse apportée
Running Code on HPC systems with differnent licenses and operating systems
The OS and the matlab runtime library version must match between the computer compiling your code and the computer running the c...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
hi every body.my question is how can i change size of plot window in Matlab. like this picture. i want change the black window size as big as blue window. i want reduce plot window border.
plot(1:100, sin(1:100)) title('basic plot'); xlabel('x axis'); ylabel('y axis'); set(gca, 'units', 'normalized...

environ 8 ans il y a | 1

| A accepté

Charger plus