Answered
How can i export a data to tab (10 character space) separated text file...
A=rand(4) dlmwrite('myfile.txt', A, 'precision', '%.8f','newline', 'pc','delimiter','\t')

13 years ago | 0

| accepted

Answered
compare value between different arrays
a=[2 3 4] b=[1 4 0] comp=a<b

13 years ago | 0

Answered
How do you convert linear array to 2by2 matrix?
Use reshape function %example x=1:20 out=reshape(x,2,2,[])

13 years ago | 0

Answered
reduce precision of a number
When you use x for calculation use out = str2num(sprintf('%.3f',x)) % when x is not displayed, the 0 does not appear! %or ...

13 years ago | 3

Answered
how to add data to the new row
num = [a; b; c;d; e; f];

13 years ago | 0

Answered
finding the power of a number
a=0.6543e+013 power=ceil(log10(a)-1) b=10^(log10(a)-power) % the result b is always between 1 and 10, if you want the re...

13 years ago | 0

| accepted

Answered
Not enough input arguments
function [ fitness ] = calcfitness( breedingpop, nbreeding, penalty ) %UNTITLED Summary of this function goes here % Detai...

13 years ago | 0

Answered
Code not setting value=0
A=10; B=1; fun=@(x) x+1/((A.*x)+(B.*x)); z=fzero(fun,eps)

13 years ago | 0

Answered
Not enough input arguments
zzzzzz is not a script it's a function, and should be called like below out=zzzzzz(modelspeed,modelresistance,propellerdiam...

13 years ago | 0

Answered
How do I turn an image jpg image into a matrix using the 'imread' command? and image analysis
M = imread('C:\Users\bostock_h\Documents\Images\130510_120.jpg')

13 years ago | 0

| accepted

Answered
How can I delete a row of numbers in which the number in the first column is less than a threshold?
A=rand(100,2) %example a=A(1,:); A(A(:,1)<0.2,:)=[]; A=[a;A]

13 years ago | 1

Answered
Help with text file duplicate and concatenation
b=char(nuova_variabile); c=cellstr(b(:,1:6)); idx=strcmp(c,'$SDDBT')'; ii=[1 diff(idx)]; out=nuova_variabile(find(ii~=0)) ...

13 years ago | 1

| accepted

Answered
Strings with changing length and cases
It's more appropriate to use IF statement Astr = '123456789' if isequal(Astr([2:4,5:7]), '234567' ) x = 5 elseif ise...

13 years ago | 0

| accepted

Answered
how do i filter from existing matrix and form separate matrix as follows?
x=[1 2 3 4 4 3 5 4 3 2 1 2 2 3 4 4 5 5]; a=unique(x); for k=1:numel(a) [ii,jj]=find(x==a(k)); out{k}=[ii jj]; ...

13 years ago | 0

Answered
Modules required for Autocode generation using simulink
If your Matlab version is relatively new, real time workshope is replaced by code generation

13 years ago | 1

Answered
how can I specify the marker name in scatter plot
set(gca,'xlabel',1:65)

13 years ago | 0

Answered
how to rename a gui
Biometric_Solution_by_M_JOSE

13 years ago | 0

| accepted

Answered
xlsread with changing Excel name
for k=1:10 filename=sprintf('rev%d.xls',k); [num, tekst, raw] = xlsread(filename,'Workbook','B9:C138'); % add...

13 years ago | 1

Answered
How do i use regular expressions effectively for parsing my text?
text='red redy predominant red ade redish red vrd redishh' pattern='(?<=\s)red(y|ish)?(?!\S)' regexp([' ' text],pattern...

13 years ago | 0

Answered
how to define a global parameter in a .m file in matlab
global var1 var2 var3 ...

13 years ago | 0

Answered
loading and accessing cell array
cell2mat(table{1})

13 years ago | 1

Answered
Find minimum difference between matrices.
A=randi(4,4) B=randi(4,4)% Example b=B(:); for k=1:numel(A) [val,idx]=min(abs(b-A(k))); C(k)=val; end C=reshape...

13 years ago | 1

Answered
How to select a fixed number of rows with constant spacing?
A=rand(210,10); % example A(fix(linspace(1,size(A,1),21)),:)

13 years ago | 0

| accepted

Answered
deriving fractions in matlab
You can also use an approximate derivation of your function: s=0:0.01:100; y=(s+2)./(s.^2+7); dy=diff(y)./diff(s) plot(...

13 years ago | 0

Answered
How to create matrices of Symbolic Variables in an earlier version of Symbolic toolbox
N=10; evalin('base',['y=sym([x1' sprintf(' ,x%d ',2:N) '])'])

13 years ago | 0

Answered
I have a large vector, how do i extract every 15th element?
out=A(15:15:end)

13 years ago | 1

Answered
Is there a way to stop Simulink from going through a function block after the first time during a Simulation
You can use <http://www.mathworks.com/help/simulink/ug/enabled-subsystems.html enabled-subsystems>

13 years ago | 0

| accepted

Load more