回答済み
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...

8年弱 前 | 0

回答済み
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 ...

8年弱 前 | 1

| 採用済み

回答済み
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; ...

8年弱 前 | 0

回答済み
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...

8年弱 前 | 1

| 採用済み

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

8年弱 前 | 1

回答済み
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...

8年弱 前 | 0

| 採用済み

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

8年弱 前 | 1

| 採用済み

回答済み
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 ...

8年弱 前 | 1

回答済み
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...

8年弱 前 | 1

回答済み
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...

8年弱 前 | 0

回答済み
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',...

8年弱 前 | 0

回答済み
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(:); ...

8年弱 前 | 0

| 採用済み

回答済み
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...

8年弱 前 | 0

回答済み
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...

8年弱 前 | 0

回答済み
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)

8年弱 前 | 0

| 採用済み

回答済み
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...

8年弱 前 | 0

回答済み
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...

8年弱 前 | 1

回答済み
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>

8年弱 前 | 2

| 採用済み

回答済み
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_...

8年弱 前 | 2

| 採用済み

回答済み
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...

8年弱 前 | 1

回答済み
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...

8年弱 前 | 0

| 採用済み

回答済み
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...

8年弱 前 | 1

回答済み
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...

8年弱 前 | 0

回答済み
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...

8年弱 前 | 0

回答済み
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...

8年弱 前 | 0

| 採用済み

回答済み
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...

8年弱 前 | 0

回答済み
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...

8年弱 前 | 4

回答済み
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

8年弱 前 | 0

| 採用済み

回答済み
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...

8年弱 前 | 0

| 採用済み

回答済み
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...

8年弱 前 | 1

| 採用済み

さらに読み込む