Answered
How can I display min and max in the colorbar?
h=colorbar t=get(h,'Limits'); set(h,'Ticks',linspace(t(1),t(2),5)

10 years ago | 2

| accepted

Answered
Create a new matrix of the old matrix
B=[0 0 0 0 1 2 3 4 5 0 0 0 2 4 6 8 10 0 0 0 3 6 9 12 15 0 0 0 4 8 12 16 20 0 0 0 ...

10 years ago | 0

Answered
To extract data from file
a=importdata('Run5.txt',' ',2) out=a.data

10 years ago | 0

Answered
Please tell me how resole this error. "Error in EXCEL_READ_WRITE (line 10) Excel_open = excel_workbook.open(filepath); "
Excel_open = excel_workbook.Open(filepath) It's Open not open (with uppercase)

10 years ago | 0

| accepted

Answered
input matrix as below
Use mod function, a number N is even if mod(N,2)==0

10 years ago | 0

| accepted

Answered
import same variable without overwrite
You are using the same variable name. If you want to append your new data, you have to store them in a new variable name. But i...

10 years ago | 0

| accepted

Answered
if i have two matrix in different size how can i subtract it By adding zeros row or column ??
x=[1 2 3;4 5 6] You can add zeros horizontally n=3 x=[x zeros(size(x,1),n)] or vertically x=[x;zeros(n,...

10 years ago | 0

| accepted

Answered
how can i add zero padding to DFT
x=[1 2 3] y=[x zeros(1,10-numel(x))]

10 years ago | 0

Answered
how to find number of bytes in a row of a matrix
Look at this example a=num2cell(uint16(randi(4,1,4))) b=num2cell(uint32(randi(4,1,4))) c=[a b] d=c(randperm(8)) % d i...

10 years ago | 0

Answered
How to return the rows with specific value?
Y=X(ismember(X(:,1),out),:)

10 years ago | 1

| accepted

Answered
How to return value of column not the index using find function?
out= A(A(:,2)==3,1) Also, with your code you found the indices idx=find(A(:,2)==3) The the result is R=A(idx,1)...

10 years ago | 1

| accepted

Answered
How can I assign a variable to the iteration number of a for loop?
jj=0; for i = degtorad(0):degtorad(1):degtorad(359) jj=jj+1 rs = (rsx*rsy)/sqrt(((rsx^2)*(sin(i))^2)+((rsy^2)*(co...

10 years ago | 0

| accepted

Answered
How can I save data to a .mat file the variables of the old .mat files aren't lost after saving new ones?
Use append option a=10; save('file','a') b=20; save('file','b','-append')

10 years ago | 0

Answered
How to change code in scripts using command
You can read the content of your m-file fid=fopen('file.m') line=fgetl(fid); k=1; while ischar(line) out{k,1}=l...

10 years ago | 2

| accepted

Answered
How can I transfer a continuous signal to a discrete signal in Simulink?
Use a Quantizer block <http://www.mathworks.com/help/simulink/slref/quantizer.html>

10 years ago | 0

| accepted

Answered
i need some help for fsolve function with input data
You are writing everything in one file, which is not correct. Save the following file as vogel.m function f=vogel(v,t,x) f...

10 years ago | 0

| accepted

Answered
can anyone read this file with matlab ?
fid=fopen('filename.dat'), d=textscan(fid,'%s'), fclose(fid) d{:}

10 years ago | 1

| accepted

Answered
How can i determine error in matlab by using error loop without try catch or other loops?
a=input('enter a number N','s') b=str2num(a) if isempty(b) 'Error' 'presse any key to cotinue' pause end

10 years ago | 0

| accepted

Answered
how can i declare 3-demension variables?
Read the documentation <http://www.mathworks.com/help/matlab/math/multidimensional-arrays.html>

10 years ago | 0

| accepted

Answered
Average Values in a matrix
a=rand(100,225) out=blockproc(a,[4 4],@(x) mean(mean(x.data)))

10 years ago | 0

| accepted

Answered
Table is not displaying cell arrays
Just use the example of the link x = (0:0.1:2.5)'; y = erf(x) p = polyfit(x,y,6) f = polyval(p,x); T = table(x,y,f,y-f,...

10 years ago | 0

Answered
if i have some matrix how can i do this operation on it ?
This is not the best way, but it works a = [ 1 3 3 1 ] b=arrayfun(@(x) [0 ones(1,x)],a,'un',0) c=arrayfun(@(x) ce...

10 years ago | 0

| accepted

Answered
How can I create a surface plot of a function of 3 variables?
syms f(x, y, z) f(x, y, z) = -x^2 - (y^2 / 4) + (z^2 / 4) == 1 syms g(x, y); g(x, y) = solve(f(x, y, z), z); % matrix([[-(4...

10 years ago | 0

Answered
how to split and transpose a cell array?
a={'12,13,14,45';'4,8,nan,nan';'450,2,14,nan'} out=cell2mat(cellfun(@(x) str2num(strrep(x,',',' ')),a,'un',0))'

10 years ago | 0

| accepted

Answered
How to split cell array separated by ',' into double array?
a={'0,0,0,2,2,0.39,0.49' '0,1,2,2,2,0.34,0.44'} out=cell2mat(cellfun(@str2num,strrep(a,',',' '),'un',0))

10 years ago | 1

| accepted

Answered
Finding eigen vector using sym and solve
G = [6 -1; 2 3]; I = eye(2,2); syms x eigvec = solve(det(G-x*I)==0)

10 years ago | 0

Answered
Dear All, I am trying to add two consecutive rows cells
A=[1 2 3] B=cumsum(A)

10 years ago | 0

Answered
Problem fonction while in Simulink
If e>0.2, you will have an infinite while loop.

10 years ago | 0

Answered
Taking Mean/average
v=rand(262080,1); %--Example---- v1=mean(reshape(v,15,[]))

10 years ago | 0

Load more