Respondida
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...

más de 7 años hace | 0

Respondida
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 ...

más de 7 años hace | 1

| aceptada

Respondida
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; ...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 1

| aceptada

Respondida
Suggestions for a laptop?
# Search for "best laptop for programming" or "best portable laptop" on the search engine. # Make sure computer meets Matlab mi...

más de 7 años hace | 1

Respondida
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...

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 1

| aceptada

Respondida
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 ...

más de 7 años hace | 1

Respondida
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...

más de 7 años hace | 1

Respondida
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...

más de 7 años hace | 0

Respondida
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',...

más de 7 años hace | 0

Respondida
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(:); ...

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 0

Respondida
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)

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 1

Respondida
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>

más de 7 años hace | 2

| aceptada

Respondida
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_...

más de 7 años hace | 2

| aceptada

Respondida
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...

más de 7 años hace | 1

Respondida
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...

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 1

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 4

Respondida
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

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 1

| aceptada

Cargar más