Answered
Value of c and n might be unused ?
A simplification: function [Nu] = nusselt(Re, Pr) if Re < 1 || Re > 250000 c = NaN; % Reply NaN if input is ou...

9 years ago | 2

Answered
Why, when running a script, matlab workspace shows variables do not present in the script?
Please read in the documentation to learn the difference between scripts and functions. Scripts share the workspace of the calle...

9 years ago | 0

Answered
Calculating knee joint angles from 3D coordinates of tracking sensors along with digitized points
Do you want to work seriously with this code? It is horrible and impossible to debug. Examples: RtsenSMCLta=[cos(ar)*cos(er)...

9 years ago | 0

Answered
How to swap values of two variables?
Cheaper than |deal|: function [b, a] = swap(a, b) % This function has no body!

9 years ago | 23

Answered
How to do xor operation?
It is strange, that the inputs are char's, but there is no need to convert them: x = {'1' '1' '1' '0' '1' '1' '0' '1'}; ...

9 years ago | 1

Answered
Problem with export_fig - eps2pdf
Start with checking the error message: C:\Users\-\AppData\Loca\Temp\tp0529ef87_f6a2_44f2_bcb9_a061dc5608cf.pdf Is this re...

9 years ago | 1

Answered
Cannot display summaries of variables with more than 524288 elements
This is *not* an error. Viewing a large 3D array as a table in the Workspace browser is simply not useful and avoided in consequ...

9 years ago | 7

| accepted

Answered
Replacing for loop of sum for something better, something like symsum, but for indexing of matrix
Summary: X = [1;2;3]; X = [ones(size(X, 1), 1), X]; y = [15;20;30]; theta = [5;5].'; % transpose it once only ...

9 years ago | 0

| accepted

Answered
Can't start Matlab.
Did you apply the suggested in the forum already? See: <https://www.mathworks.com/matlabcentral/answers/99457-how-do-i-activa...

9 years ago | 0

Answered
How to stretch the cells of a matrix ?
img = rand(30, 30, 3); figure('Menubar', 'none', 'Toolbar', 'none'); axh = axes; image(axh, img); axh.DataAspectRa...

9 years ago | 1

| accepted

Answered
Find double repetitions in a (sorted) array.
Your code looks like the input is sorted. The other approaches do not have this limitation. If it is really sorted: d = ...

9 years ago | 0

Answered
Wait for a condition to be met...
But |ginput(n)| waits already until the user has pressed the key n times. Then if nIn = 2. I click twice on a graph, BatchAb...

9 years ago | 0

| accepted

Answered
minus function giving ambiguous output
Welcome to the world of numerics with limited precision. The result is *not* ambiguous, but expected and well defined. As you...

9 years ago | 0

Answered
I am unable to understand F(88,88) = 0
You can start the investigations the other way around: Create the FFT of a noise free image, and set one element to a large valu...

9 years ago | 0

Answered
Load Files from User Input?
file = input('What file would you like to open?', 's'); data = load(file) A more convenient method would be |uigetfile| ...

9 years ago | 2

Answered
how to find the euclidean distance between two images
* Euclidean distance between two images: Dist = sqrt(sum((image1(:) - image2(:)) .^ 2)); % [TYPO fixed, thanks Sean] Th...

9 years ago | 1

Answered
Computer/IP that was originally used to write a matlab code
You are a MATLAB course instructor. We should expect, that you know the simple nature of text files like M-files. They contain o...

9 years ago | 1

Answered
Validity for MatLab student license
It depends on how long you will be studying. Student versions are working for students only. A short search in the net reveal...

9 years ago | 2

| accepted

Answered
Plotting the third and firth order polynomial of a function?
t = 0:10; y = exp(-0.5 .* t) .* sin(t); % Elementwise .* instead of matrix multiplication * Read the documentation of |...

9 years ago | 1

Answered
Draw growing circles on a jpeg file.
You can remove the object by the |delete| command: image(rand(640, 480, 3) * 0.5); h = viscircles([200, 200], 5); pau...

9 years ago | 0

| accepted

Answered
How do I get and index to a row (comparing a string to a column of the table) in a table as I could with strmatch?
The replacement of rowidx = strmatch('7890808.20180808', MRSresultsTable.Spectro_Study_ID) by rowidx = find(strncmp...

9 years ago | 0

Answered
Permutations Cycles Counting ... speed up
% VERSION 1 [nR, nE] = size(p); count = zeros(nR, 1); for j = 1:nR q = p(j, :); % <== Cut out a vector t...

9 years ago | 1

| accepted

Answered
can i obtain this vector ?
V = cumsum([3, 1, 3, 1, 3, 1]) - 2

9 years ago | 0

Answered
How to add blank spaces in a text file?
inFID = fopen(inFileName, 'r'); outFID = fopen(outFileName, 'w'); if inFID == -1 || outFID == -1 error('Failed at ...

9 years ago | 0

| accepted

Answered
Put cells with rowise strings togehter
fprintf(fid, '%s\n', YourCell{:}); I don't think that this is much faster. Try to open the file with the 'W' flag instead o...

9 years ago | 0

Answered
I Need the matlab code for the attach equation.
A = mean(sub_band(:) .^ 2);

9 years ago | 0

Answered
Error using readtable: PATTERN must be a string scalar or character vector.
You can use <https://www.mathworks.com/matlabcentral/fileexchange/27861-uniquefuncnames FEX: UniqueFuncNames> to search for shad...

9 years ago | 0

Answered
ImageMagick through command line
You did not post the code you use, but !convert image.png -dither FloydSteinberg -remap ColorMap.png remap remap_image.png ...

9 years ago | 0

Answered
How do I display a table converting from radians to degrees using these five values for the radian angle: 1, 2, 3, 4, and 5?
* Can you create a vector containing the numbers [1,2,3,4,5]? * Do you know how to convert radians to degrees? It is a simple m...

9 years ago | 0

Answered
How to open tiff stack images in for loop
The error message means, that the file cannot be opened. Most likely it does not even exist, because the path is wrong. Use an a...

9 years ago | 0

Load more