Answered
Read some data from a file containing numbers and characters
p='SEGMENT BOUNDARY SAMPLES' fid=fopen('file.txt'); a=fgetl(fid); test=isempty(regexp(a,p)); while ischar(a) & test==1 ...

11 years ago | 0

| accepted

Answered
read sentences from an excel file
Use xlsread

11 years ago | 0

| accepted

Answered
Importing a CSV file as a nested cell array - is it possible
Import your data, then get ride of nan

11 years ago | 0

Answered
repeat elements in matrix
m=4; n=2^(m-1); b=zeros(m,n); for k=0:m-1 a=1:2^k; b(k+1,:)=reshape(repmat(a,n/numel(a),1),1,[]); end b Or ...

11 years ago | 0

| accepted

Answered
Horizontally Merge Columns from Two Different Matrices
Data=[Degree(:,2) Degree1(:,2)] Read the documentation <http://www.mathworks.com/help/matlab/math/creating-and-concatenati...

11 years ago | 0

Answered
Finding x that approximate y to zero
e= 0.01 %error bar x = linspace(100, 170, 1000); y = 18.9*log(x/170) +0.0042*(x-170) + 8.314*log(0.000267/0.0001413); i...

11 years ago | 0

| accepted

Answered
How do I break numeric vector into variable length sections and combine in a matrix
A=[1,4,15,56,58,59,68,79,3,45,12,34,62,90] a= diff(A)<0; idx1=[1 find(a)+1]; idx2=find([a 1]); n=max(idx2-idx1)+1; m=nume...

11 years ago | 0

Answered
Find matching rows of cell arrays containing strings
B=circshift(A,[-1 0]) *Edit* A = {'ABC' '123'; 'A' '100'; 'C' '0'}; B = {'A' '100'; 'C' '0'; 'ABC' '123'} [n,m]=size...

11 years ago | 0

| accepted

Answered
how to solve Conversion to cell from double is not possible
F={1;1:2;1:3;5:10} f=zeros(numel(F),1); for i=1:numel(f); f(i)=numel(F{i}); end f Or simply f=cellfun(...

11 years ago | 0

| accepted

Answered
Can someone please help with following conversion :
datetime was introduced since Matlab 2014b, what is your Matlab version?

11 years ago | 1

| accepted

Answered
Join elements of an array
a=[1 2 3 0] b=[0 0 5 4] idx=a==0 bb=sort(nonzeros(b)) a(idx)=bb(1:sum(idx))

11 years ago | 0

Answered
Scatter plot using secondary axis of plotyy
[ax, p1, p2]=plotyy(x1,y1,x2,y2); hold(ax(1),'on') scatter(ax(1),x1,y3); hold(ax(2),'on') scatter(ax(2),x1,y4)

11 years ago | 1

| accepted

Answered
How do I add my own instruction help text and pages to a GUI
You can add your help in a menu <http://www.mathworks.com/help/matlab/creating_guis/creating-menus-in-a-guide-gui.html>

11 years ago | 0

| accepted

Answered
Scatter plot- changing symbols based on colour
X=1:10 Y=sin(X) W=randi([0 1],numel(X),3) cl=dec2bin(1:2^3-1)-'0' sh='os<>dv^' figure hold on for k=1:numel(X) sca...

11 years ago | 0

Answered
How to use a loop to find a sum and average?
Read the <http://www.mathworks.com/help/matlab/getting-started-with-matlab.html Getting started>

11 years ago | 0

Answered
How to read required information from particular line
fid=fopen('file.txt') a=fgetl(fid) k=0 while ischar(a) k=k+1 r{k,1}=a a=fgetl(fid) end fclose(fid) id=fin...

11 years ago | 0

Answered
Make the vector lin=[1 2 3 ⋯ 20] (the integers from 1 to 20), and then make every other value in it negative to get lin=[1 −2 3 −4 ⋯ −20] . what is the MATLAB code?
a=-(1:20) Read the <http://www.mathworks.com/help/matlab/getting-started-with-matlab.html documentation>

11 years ago | 0

Answered
How to Implement a counter which counts from 0 to 32767 and once it hits 32767 then reset the counter and raise a fault flag once and reset it back in Simulink Model
Use a <http://www.mathworks.com/help/simulink/slref/counterfreerunning.html counter free runing> and set the number of bits to 1...

11 years ago | 0

Answered
How to find cell where max is located?
A=[1 2 0 6 1 -1] [max_val,idx]=max(A)

11 years ago | 0

Answered
Delete row not following pattern
a = [ 2 5 2 0.504; 3 6 2 0.507; 3 4 1 0.589; 9 4 2 0.503; 8 3 1 0.592; 3 2 2 0.203; 9 5 2 0.341; 4 8 1 0.592] c3=a(:,3) c4=a...

11 years ago | 0

Answered
How can I run this function?
Assign values to f,grad,x0,toll,maxiter f= grad= x0= toll= maxiter= [ x,fx ,iter,x_vett]=gradiente(f,grad,x0,toll,max...

11 years ago | 0

Answered
How do I create a table from an equation?
r=10 [x,y,z]=sphere x=x*r y=y*r z=z*r

11 years ago | 0

Answered
Matrix, vector, plot, combination
plot(X(1:10:end),Y(2,1:10:end)')

11 years ago | 0

Answered
output to excel file. how can each data be stored in different column rather than all all data in single column.
Use <http://www.mathworks.com/help/matlab/ref/xlswrite.html xlswrite> to export your data

11 years ago | 0

| accepted

Answered
read-open many files
You didn't specify the type of files (text file or Excell or ...). Suppose they are text files for k=1:200 FileName...

11 years ago | 0

Answered
How to convert a binary string to modulus values?
Use bin2dec and dec2bin

11 years ago | 0

Answered
how to draw multiple dots in between two vertical lines?
x1=[ 1 1 ] y1=[-1 1 ] x2=[ 2 2] y2=[ -1 1] plot(x1,y1,x2,y2,'linewidth',4) [ii,jj]=meshgrid(linspace(x1(1),x2(1),20),lin...

11 years ago | 0

Answered
How can I control block parameter value by input port at Altera DE2-115 FPGA ?
You can create your own sine block <</matlabcentral/answers/uploaded_files/33942/ans1_2015.jpg>> In this figure, the freq...

11 years ago | 0

Answered
What does '& ...' mean in Matlab?
&... is not an expression. & can be used as logical "and" operator Example a=10 b=20 a==10 & b==2 is equivalent t...

11 years ago | 0

| accepted

Answered
How to instantly substitute all the Ai_j of a symbolic matrix A?
A = sym('A', [3 3]) Ai=inv(A) a=[1 2 3; 5 4 6; 7 8 9] arrayfun(@(x,y) assignin('base',char(x),y),A,a) double(subs(Ai))

11 years ago | 0

Load more