답변 있음
degrees2dms convertion anomally.
format long g dms = degrees2dms(35.55) This is a typical effect of the limited precision of doubles. Most decimal numbers cann...

대략 4년 전 | 0

답변 있음
Comparison of very large numbers
No, ismember does not round the values. Your assumption does not match the facts. Why do you think that a rounding is applied? ...

대략 4년 전 | 0

답변 있음
Compare array value to variable value
if x > array{1} && x < array{2} You need curly braces instead of round parentheses. array(1) is a {1 x 1} cellm while array{1} ...

대략 4년 전 | 0

| 수락됨

답변 있음
why does websave creates empty files?
path_to_save = "E:"; out_name_path = path_to_save+filename; This produces file names like "E:A_20080401_5.xml"...

대략 4년 전 | 0

| 수락됨

답변 있음
how can one specify a directory that websave saves files?
Using full path names is the reliable and efficient solution: Folder = 'C:\Your\Favorite\Folder'; File = 'AsYouWant.html'; ...

대략 4년 전 | 0

| 수락됨

답변 있음
How can I change in the directory while using dlmwrite?
I do not understand, what the problem is. The function tempname creates a file in your TEMP folder. Under Windows this is: C:\Us...

대략 4년 전 | 0

답변 있음
Error that does not make sense.
You can be completely sure, that the error occurs only, if the conditions are met. Matlab is not tired or evil, but a determinis...

대략 4년 전 | 0

답변 있음
System of equations with array inputs
Your file eqns_optimtax.m starts with the line: global Yc Yd An m file starting with code instead of the keyword "function" is...

대략 4년 전 | 0

답변 있음
How can I solve this error?
Omit the lines: clear all close all Note, that clear all deletes all loaded functions from the RAM and reloading them from th...

대략 4년 전 | 0

답변 있음
Why the results are different when use different letters?
Because the equations are different: syms rs xs rp xp syms a b c d [rp, xp] = solve(rs * rp^2 + rs * xp^2 == xp^2 * rp, xs...

대략 4년 전 | 0

답변 있음
How to adjust data
A bold guess: Maybe because you overwrite Yaxis(1,1) before? Yaxis(1,1) = Yaxis(1,2); Yaxis = Yaxis-Yaxis(1,1); Simpli...

대략 4년 전 | 0

답변 있음
Is there a way to obtain handles to the last N figures that were opened?
The list of children or the HG root object is reliable: function H = getLastFigs(N) H = get(groot, 'Children'); H = H(1:min(n...

대략 4년 전 | 2

| 수락됨

답변 있음
sound is coming after the picture has disappeared
x = (rand(1, 70000) - 0.5) * 0.1; sound(x, 8000); pause(1) clear('sound'); % Undocumented The sound() command calls the m...

대략 4년 전 | 0

답변 있음
Integral of exponential- Incorrect result
Reduce the tolerances: format long fun = @(x) (((1e-5 * x) .^10) .* exp(-x / 1000)); xmin = 0; xmax = 40000E3; xint1 = int...

대략 4년 전 | 1

| 수락됨

답변 있음
How to repeat elements of array in MATLAB
Replace: row(:,end+1:N)=0; by row(:,end+1:N) = row(1:size_MP);

대략 4년 전 | 0

| 수락됨

답변 있음
Stop Matlab ignoring numbers
format long g This enables more visible digits. You get the complete control over the output format, if you use fprintf() inste...

대략 4년 전 | 0

| 수락됨

답변 있음
wait until picture selection.
You could add a button "Select this" to all open figures: function pushbutton15_Callback(hObject, eventdata, handles) openFig ...

대략 4년 전 | 0

| 수락됨

답변 있음
fread function for reading 10 bit raw file.
If the 10bit data are written as bitstream, 8 numbers use 10 bytes. If you read this as UINT8 or UINT16 does not matter: the seq...

대략 4년 전 | 0

답변 있음
If I start with a matrix of zeros, how can I easily create a Hypocycloid of ones in that matrix?
A point to start from - it is not hard to expand this to fill elements of the zero matrix: M = zeros(512, 512); a = linspac...

대략 4년 전 | 0

답변 있음
I need help in MATLAB code for general tan function with taylor series
Bn are the Bernoulli numbers: https://en.wikipedia.org/wiki/Bernoulli_number WikiPedia is the first point to start a search fo...

대략 4년 전 | 1

| 수락됨

답변 있음
Removing part of file name (random numbers )
Names = ["A_m_T17__75788", "A_m_T18__63071", "A_m_T19__51148"]; Cleaned = extractBefore(Names, '__')

대략 4년 전 | 0

| 수락됨

답변 있음
"Index exceeds the number of array elements"
The loop fails in the last iteration due to k(i+1). This requests k(T+2), which is not existing. So maybe this solves the proble...

대략 4년 전 | 1

답변 있음
Check if a value is within one of the cells in a cell array
Working with cells makes it harder. If you only want to know, if any 6 is contained: y = {[1,2],[2,3.51],[2,5],[2,6]}; T = any...

대략 4년 전 | 1

답변 있음
What is recommended way to store code snippets like utility functions?
Yes. Store the tools in their own folder, exactly as you can see it for Matlab's toolboxes. You can distinguish "tools", which s...

대략 4년 전 | 0

| 수락됨

답변 있음
plotting graphs in different figures with different domains
This opens 2 figures and draws 2 diagrams: figure; plot(1:10, rand(1,10)); figure; plot(11:20, rand(1,10));

대략 4년 전 | 0

답변 있음
1 == 0 ?
Replace if matrice(m,n) == 0 by if matrice(i,j) == 0 Currently you are checking the last element of the matrix in each itera...

대략 4년 전 | 1

| 수락됨

답변 있음
Incorrect dimensions for raising a matrix to a power. Check that the matrix is square and the power is a scalar. To perform elementwise matrix powers, use '.^'.
This line is failing: i0_a = (i0_ref_a) * (Glucose_conc/Glucose_ref)^(gamma_anode); The error message contains some valuable h...

대략 4년 전 | 0

| 수락됨

답변 있음
In the function datenum's formatin, does the 'HH' represent the same as 'hh'?
This is Matlab. Simply try it: test2=[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25]; newStr=num2str(test2');...

대략 4년 전 | 0

| 수락됨

답변 있음
How to concatenate binary strings?
s = char('0' + randi([0,1], 8192, 8)); % Some test data r = reshape(s.', 32 * 8, []).'; % Create a 256 x 256 matrix

대략 4년 전 | 1

답변 있음
Plot not shown in for loop
Exactly. Give Matlab a chance to update the output by inserting the command: drawnow inside the loop.

대략 4년 전 | 0

더 보기