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

7 years ago | 0

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

7 years ago | 1

| accepted

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

7 years ago | 0

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

7 years ago | 1

| accepted

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

7 years ago | 1

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

7 years ago | 0

| accepted

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

7 years ago | 1

| accepted

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

7 years ago | 1

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

7 years ago | 1

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

| accepted

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

| accepted

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

7 years ago | 0

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

7 years ago | 1

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

7 years ago | 2

| accepted

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

7 years ago | 2

| accepted

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

7 years ago | 1

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

7 years ago | 0

| accepted

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

7 years ago | 1

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

| accepted

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

7 years ago | 0

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

7 years ago | 4

Answered
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

7 years ago | 0

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 1

| accepted

Load more