Solved


Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

7 years ago

Solved


Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

7 years ago

Solved


Target sorting
Sort the given list of numbers |a| according to how far away each element is from the target value |t|. The result should return...

7 years ago

Solved


Duplicates
Write a function that accepts a cell array of strings and returns another cell array of strings *with only the duplicates* retai...

7 years ago

Answered
Split binary number into individual bytes
This approach save the result in a cell array: fid = fopen('File.txt'); data = textscan(fid,'%s'); fclose(fid); dataNew = ce...

7 years ago | 0

| accepted

Answered
select rows satisfying a particular condition
a = randi([0,2],5,10); start_index = 1; end_index = 3; b = mat2cell(a(start_index:end_index,:),ones(1,end_index-start_ind...

7 years ago | 1

Answered
Specifying attributes of objects created in GUIDE
set(handles.yourButton,'Units', 'pixels') %If your position is in pixels set(handles.yourButton,'Position', [1.0, 1.0, 2.0, 1.5...

7 years ago | 0

Answered
Problem with logical indexing
I think you have a typo, calling infinite times the function freezing, then: function numfreeze = freeezing(temperatures) ...

7 years ago | 1

Answered
How to order a matrix?
Try this: [~,ia,~] = unique(A(:, 2:3),'rows','stable'); B = A(ia,:);

7 years ago | 0

Answered
Correct error in logical indexing
Your loop only runs for k = length(PassCoord), you need to put the limits of k (1:length(PassCoord)): for k = 1:length(PassCoor...

7 years ago | 1

| accepted

Answered
Matlab saying that cell is empty when it is not?
Your loop is not a loop in fact (it is only running for i = 1460, the last cell). Then you need: for i = 1:1460; hours{i} ...

7 years ago | 1

Answered
explain the working of this code ??
It is an inefficient way to count the number of 1's in matrix I

7 years ago | 1

Answered
how to save this figure with plot to tif
This is a good solution: https://es.mathworks.com/matlabcentral/fileexchange/23629-export_fig

7 years ago | 0

Answered
[QA]How to load parameter in *.m file by matlab script into workspace
The function callParam doesn't have any output variable. Then you need something like function CONST_PARAM = CallParam ru...

7 years ago | 0

| accepted

Answered
How to find common rows between two cell arrays containing string values?
An option: A = {'ABC','DEF';'HTG','JUKI';'RTHG','KIO'}; B = {'HTG','JUKI';'GHTY','UJIK';'RTGHY','IOP'}; setdiff(A,setdiff(A,B...

7 years ago | 0

Answered
Cell array / Concatenate non - NaN results
A(cellfun(@isnan,A)) = [];

7 years ago | 0

Answered
How to get Matlab read my char file in excel?
Is this that you want? [~,text,~] = xlsread(filename); text = char(text);

7 years ago | 0

Answered
Rearrange matrices in a cell array
data = cell(1,10); data(:) = {deal(rand(4))}; idx = 1; x = rand(4); newData = [data(1:idx-1),x,data(idx:end-1)];

7 years ago | 1

| accepted

Answered
help with this problem please
A good option is to use the try catch statement, then: prompt = {'Choose the figure name','Choose the Tree name',... ...

7 years ago | 0

| accepted

Answered
I have two guis and I need to share data between them.how to share data between them
The best option is to use setappdata and getappdata functions: https://es.mathworks.com/help/matlab/ref/setappdata.html https:...

7 years ago | 0

Answered
Matlab iteration through excel rows
Try this, is that you want? filename = 'example.xls'; excelSheet = 'example'; columnName = 'Name'; columnDefault = 'Default'...

7 years ago | 0

Answered
What wrong in line 12 ?? help me please (Index exceeds matrix dimensions.)
In this line: u1(n+1)=u1(n)+1/2*(4*exp(0.8*t(n))-0.5*u1(n)+4*exp(0.8*t(n+1))-0.5*u3(n)); the length of t is n, then t(n+1) giv...

7 years ago | 0

Answered
How can I increase this code's efficiency?
There are many options, but the main goal is to reduce the number of calls to xlsread (it is really slow). One option: function...

7 years ago | 1

| accepted

Answered
Creating a cell and allocation specific text
result = cell(1,length(beta)); result{1} = {'Intercept'}; result(2:end) = sprintfc('X%d', 1:41);

7 years ago | 1

| accepted

Answered
how can i plot in the while loop
Then, you simply need this: t=16; d=23; M=5; N1=floor(((275*(1/M))-30+d)-2); s1=23.45*sind((360/365)*(284+(N1+2))); l=35.4...

7 years ago | 0

| accepted

Answered
Swap group of elements in a matrix with specific conditions
Try this: a(:,[3,4]) = sort(a(:,[3,4]),2,'descend');

7 years ago | 0

Answered
Numerical solution of a matlab function.
Try changing the interval fplot(F,[0,1e7]) Then, you can use: fzero(F,1e5) ans = 9.6575e+05

7 years ago | 1

| accepted

Answered
Index exceeds array bounds error in nested for loop
The length of A is 8. In this loop for x=1:1:i for j=1:1:(N/2) B{j} = imadd(A{x},A{x+1}); x...

7 years ago | 0

| accepted

Answered
If statement for equal rows from two different files
Try this: A = [4.1 5.3 0.02;0.4 1.0 1.11;5.8 0.4 0.85] B = [6.0 2.1 0.82;0.4 5.3 1.00;4.1 5.3 0.02;7.2 0.2 1.57;0.4 1.0 1.11;5...

7 years ago | 1

| accepted

Answered
Value must be a 1x2 vector of numeric type in which the second element is larger than the first and may be inf
Use fplot: interval=[0 10]; y=@(x) 1/x; fplot(y,interval)

7 years ago | 0

Load more