Answered
How can I test for a return in 2010a
Sure...just add another return variable flag and test it... function [other return vars flag]=yourfunction(inputs) ......

12 years ago | 0

| accepted

Answered
Forming a large matrix out of 2 separate column matrix.
I presumed you could see how to get from the simpler "Matlab way" of computing the power series to the scaled version, sorry... ...

12 years ago | 0

| accepted

Answered
plot with manual created ticks of equal length
Their values range from ~1 to 100 but they set the ylim lower limit to 0.1 so the base plateau is nearer the midpoint of the axi...

12 years ago | 0

| accepted

Answered
fprintf has been giving blank files
_It was my understanding that 'w', or write, would take all of my variables and save them..._ I've no idea what would have gi...

12 years ago | 1

Answered
Function for limit range
Not builtin but it's simple enough to create... function y = bound(x,bl,bu) % return bounded value clipped between bl ...

12 years ago | 8

Answered
Curve fitting tool with custom equation, odd power polynomial
That to me indicates the odd-only terms aren't a very good model for your data, first off. Did you look at the interval estimat...

12 years ago | 0

Answered
How to read data of files which are in the same folder
Firstly, have you checked size() txt after the *dir* call? You don't want *fullfile* here -- >> fullfile('dry','*.txt') a...

12 years ago | 0

Answered
Problem with understanding timestamp read from a binary file using fread
nt_32=fread(fid,'4*uint32',4); From doc for *fread* -- When SKIP is used, the PRECISION string may contain a positiv...

12 years ago | 0

Answered
Bar plot with different label for each bar
Tick labels don't have the facility to be modified other than font characteristics but you can use *text* to label wherever you ...

12 years ago | 0

Answered
Visualise value and frequency of vector elements?
Same result here--Looks like a bug to me... Workaround I found was to create a 2xN array w/ the second row set to NaN. *bar*...

12 years ago | 0

Answered
I need to print a string of text to a file. Then I need to put something in a for loop that will print values from a matrix
OK, good to post your try...do try to format it for legibility though--put a blank line and two blank spaces in front of the...

12 years ago | 0

Answered
insertion and replacement of specific rows and columns
_"... square of col 1 and square-root of col 1 and append them ... similarly for col 2 and every other columns..."_ OK, takin...

12 years ago | 1

Answered
How can I plot this graph ?
Define the data over the various time intervals and plot...you can simply concatenate the disparate piece together in one X,Y ve...

12 years ago | 0

| accepted

Answered
How to replace a column in a txt file
Only practical way is to read into a cell array, modify the contents of the cells in column 2 as desired and write back out. Te...

12 years ago | 0

Answered
insertion and replacement of specific rows and columns
Those are all subsets of addressing Matlab arrays and the use of the *colon* operator. I recommend going to the "Getting Star...

12 years ago | 0

| accepted

Answered
I have two problems....
for g=1:11 new_variable = dkc(dkc(:,g)~=0, 2); end A) The above replaces new_variable each pass through so what...

12 years ago | 0

| accepted

Answered
How to Plot a Date on the X Axis using xlsread?
Select the column that contains the date and convert to Matlab _datenum_. Then use *datetick* to format the x-axis in time unit...

12 years ago | 0

| accepted

Answered
How to compare two proportions ?
Start by simply converting the ASCII to another logical array of 0/1... xA=ismember(x2,'Condition A'); % swap 'B' for 'A' ...

12 years ago | 0

Answered
How to generate multiple random samples of size 200
rnv=randn(200,1000); % generate 1000 column samples of 200 Refer to the subsample sets as _rnv(:,idx)_ where _idx_ is the de...

12 years ago | 0

| accepted

Answered
[HELP] How to seperate cell with values greater than 230 into new cell.
Looks like your first cell isn't numeric but text. Use Vnew=V([false [V{2:end}]>230]); where the extra _false_ in the r...

12 years ago | 0

Answered
how to skip incomplete and missing lines when reading from Text file?
dataArray = textscan(fileID, formatSpec, 'Delimiter','', 'WhiteSpace', '', ... A) You don't show _formatSpec_ B) The del...

12 years ago | 0

| accepted

Answered
How to convert a .txt to .cdf ? Needed for Matlab that won't read txt as cdf
I seriously doubt the extension has anything to do with it; the message indicates it's either not actually a _.cdf_ file at all ...

12 years ago | 0

Answered
Why does my code result in unlimited ans = 1, when that is not in my code?
The *else* clause is improperly formed--it cannot have anything as a conditional whereas you've written else (right & left...

12 years ago | 0

| accepted

Answered
format specifier to store log output
Use the precision specifier on the format string. From help fprintf FORMAT is a string that describes the format of ...

12 years ago | 0

Answered
[HELP] How to seperate cell with values greater than 230 into new cell.
You have to dereference the content of the cell -- "use the curlies, Luke". newV={V{:}>230); See documentation on using ...

12 years ago | 0

Answered
plotting 2 data sets of matrix
A) Don't write arrays unnecessarily in Matlab-- data(:,1)=10*[1:10].'; data(:,2)=3000+[1:10].'; B) plot(data(:...

12 years ago | 0

Answered
Not enough input arguments.
function [ f ] = funcion( x ) f = cos(2*x+1)+x.^2+x.*sin(x)+(1/3)*exp(x/5); Looks ok other than you're missing a dot ...

12 years ago | 0

Answered
how to preallocate a variable
It means you're building an array ( _a_ in this case) an element at a time. To do that means that each pass thru the loop the a...

12 years ago | 0

| accepted

Answered
how can I define an excel woorksheet in Matlab that consider the location of cells with equal numeric value and change them into specific values that I want.
It's so trivial in Matlab; just import the array; make the changes and rewrite (assuming you _must_ use Excel at all; why can't ...

12 years ago | 1

| accepted

Answered
how do i randomly sample a sinewave?
yrand=y(randperm(length(y),K)); returns K random samples from y

12 years ago | 0

| accepted

Load more