回答済み
Simple Matlab Random Number Generation
How about a brute-force approach? ntot = 0; n = 10000; x = zeros(n,5); while ntot<n r = rand(100,4)-0.5; ...

15年以上 前 | 1

回答済み
Connecting Points in a Scatter Plot
Focusing just on the problem at hand, I'd suggest # changing line 126 to |Thrust(mdotfuel+1,mach,Alt) = mdotfuel*(U8-Uo);| #...

15年以上 前 | 0

| 採用済み

回答済み
xls export problem
OK, your problem is the special characters in the string. You can't have slashes and line breaks in a filename. When you do ...

15年以上 前 | 0

| 採用済み

回答済み
how can I create a matrix from calculated answers
M = zeros(n); for k = 1:n % calculate y M(k,k) = y; end Or, preferably, if you can calculate all the y values in ...

15年以上 前 | 0

回答済み
Help regarding "format long"
Welcome to the joy of round-off error. 0.0002 is not exactly representable in binary, hence adding these floating point numbers...

15年以上 前 | 1

| 採用済み

回答済み
How can I group data and plot them with unique markers for each group?
Given your description of the data and what you're trying to do with it, I'd say you really need Statistics Toolbox. Then use d...

15年以上 前 | 0

回答済み
How would I solve y'' = sinh(y) using finite differences?
Great, if it doesn't have to be a specific FD formulation, you can use <http://www.mathworks.com/help/matlab/ref/bvp4c.html |bvp...

15年以上 前 | 1

| 採用済み

回答済み
Drawing and animation in Matlab
Doh. Too late. Still, how's this: paths = [3,3,2,1,1;1,2,1,3,2;3,3,3,2,3]; [m,n] = size(paths); th = linspace(0,...

15年以上 前 | 0

回答済み
find row of point in plot
Here's an interactive approach: % Make some data data = rand(10,3); otherdata = randi(5,10,3) % Plot plot3(data...

15年以上 前 | 0

| 採用済み

回答済み
Matlab max array size
Technically, 25920-by-1296 is 256.3Mb, but let's not quibble over a few meg :) If you're on a Windows machine, type |memory| ...

15年以上 前 | 0

| 採用済み

回答済み
Log scale graphic with negative value
Oookay, I think I have it. If you're going to do this a lot, you may want to make yourself your own function. So, see if this ...

15年以上 前 | 0

| 採用済み

回答済み
Problem save
If you want ascii, why not just write out using |fprintf|? fid = fopen('a.txt','wt'); fprintf(fid,'%hd\n',a); fclose(...

15年以上 前 | 0

回答済み
Handling excel file
Why not import everything, then strip out any blank rows? [~,~,x] = xlsread('foo.xls'); x(all(cellfun(@isempty,x),2),:) ...

15年以上 前 | 0

回答済み
Estimate an expression for a Probability Density Function
By the "cumulant" function, do you mean the cumulative probability density? Because, in that case, the PDF is just the derivati...

15年以上 前 | 0

回答済み
fprintf in a for loop printing repetitive answers in command window
Your code is hard to read b/c of the formatting, but it seems to me that you're trying to do something very similar to <http://w...

15年以上 前 | 0

回答済み
How to convert my gui program to an exe file?
# Make sure you have MATLAB Compiler and a supported C compiler # Run the command |mbuild -setup| to select your C compiler # ...

15年以上 前 | 5

| 採用済み

回答済み
How do I generate a given Matrix in one command?
A = full(gallery('tridiag',ones(1,4),ones(1,5),ones(1,4))) But my current favorite: A = 1-reshape(mod(floor((1:25)/3),...

15年以上 前 | 3

回答済み
GUI Output
As Matt Fig says, it would help to know what you're doing to get a vertical stack. Are you using |char| of a cell array of stri...

15年以上 前 | 0

回答済み
Multiple use of polyfit - could I get it faster?
In the manner of Jan's answer, just stripping down to a brute-force least-squares fit can give a lot of speed-up. I'm assuming ...

15年以上 前 | 2

回答済み
Basic Function Error (Plot Related
The operator you're looking for is |.^| (ie |x.^2|) And similarly |.*| and |./|

15年以上 前 | 0

回答済み
please help me in loading data to matlab
Would you be surprised if I suggested that what you really need is Statistics Toolbox? But, the brute-force way in MATLAB cou...

15年以上 前 | 1

回答済み
Debug this: for loop
Quick diagnostic: display the value of |P| (after it's returned by |bwlabel|)

15年以上 前 | 1

回答済み
please help me in loading data to matlab
BTW, best practice is to accept the answer that solved your initial question, then start a new question for the follow-up. That...

15年以上 前 | 1

回答済み
How do I create a varying number of outputs from a function file?
Sounds like you're looking for |varargout|. It's a cell array, with each cell holding one of the outputs. To see how many outp...

15年以上 前 | 0

回答済み
Log scale graphic with negative value
Richard pretty much beat me to it. Here's a slightly more automated way to get the tick marks. However, unfortunately there's ...

15年以上 前 | 2

回答済み
Log scale graphic with negative value
Dumb question, but is there any reason you can't just look at the absolute values? ( |abs| in MATLAB)

15年以上 前 | 0

回答済み
Dumb mistakes we make with MATLAB.
More in keeping with the OP, and another in the "physician heal thyself" category: [fiddling about at the command line, tryin...

15年以上 前 | 3

回答済み
Import Excel and plot
Run the line |[numbers,colNames] = xlsread(fileName);| from the Command Window (with the appropriate |fileName| filled in, obvio...

15年以上 前 | 0

| 採用済み

回答済み
please help me in loading data to matlab
Similar to what Andrew said, but I'd go with fid = fopen('Adult.data'); A = textscan(fid,'%f%s%f%s%f%s%s%s%s%s%f%f%f%s%s,'d...

15年以上 前 | 2

| 採用済み

回答済み
Saving memory by reusing a variable name?
I'd guess they'd be the same. Matrix multiply requires having to make an intermediate variable anyway (behind the scenes, if no...

15年以上 前 | 2

さらに読み込む