Answered
Faster way of replacing multiple rows with same vector without using a loop?
idx = [1 3]; a(idx,:) = 0

7 years ago | 0

Answered
Fast way to replace elements in a matrix?
idx=all(a>250,2) % logical index L_idx=find(idx) % linear index , gives row number

7 years ago | 0

| accepted

Answered
delete rows in a cell array
C={'country1' 11 33 55 40 'country2' 22 0 0 0 'country3' 58 44 55 5 }; idx=cellfun(@all,C,'un',0); C(...

7 years ago | 0

| accepted

Answered
can example written im matlab 2018b work in 2017b?
I believe you need 2018b version to run that example.

7 years ago | 0

| accepted

Answered
sorting of matrix using multiple conditions
ia = a>2 & a<10 ; ib = b>110 & b<130 ; Final_result = ia & ib

7 years ago | 0

| accepted

Answered
Dimensions of matrices being concatenated are not consistent.
data = [in ; out]' % ^-—-—-^-—missed it

7 years ago | 0

| accepted

Answered
how to solve for a variable in an equation
doc solve

7 years ago | 0

| accepted

Answered
what is the meaning
Did you check the output first? Val=[double(logical(1:5)) 0] % double converts other classes to double and the array at the end...

7 years ago | 0

Answered
How can I plot a 3D mesh plot for the following data?
doc meshgrid doc mesh

7 years ago | 0

| accepted

Answered
excelで選択した行のみ出力したい
Read the whole file and then split the essential datas like shown below: datas=xlsread(...); x=datas(1:2:end,:); y=datas(2:2:...

7 years ago | 1

| accepted

Answered
Replace elements of a matrix
By logical indexing: A(A==4)=10 % likewise follow the same way for the rest Read https://blogs.mathworks.com/loren/2013/02/20/...

7 years ago | 1

Answered
what is the meaning of following code?
You need to start learning the basics of matlab : https://www.mathworks.com/company/newsletters/articles/matrix-indexing-in-mat...

7 years ago | 0

Answered
fprintf for command window
According to your question https://www.mathworks.com/matlabcentral/answers/441913-how-to-use-fprintf-to-create-output-for-comman...

7 years ago | 0

Answered
How do i make the title, axes labels, and legends larger in existing figures?
Yes just create a handle and manipulate to your wish: l=legend(...) l.FontSize=2*9; % twice than default size x=xlabel(...) ...

7 years ago | 0

Answered
How to make a contour plot of a matrix consisting of 1 and NaN from a 3D array ?
contourf(squeeze(mean(imgd3,'omitnan')))

7 years ago | 0

| accepted

Answered
Transform from excel HH:MM:SS data to Matlab
Use readtable() to read the file.

7 years ago | 0

Answered
Index exceeds the number of array elements
x=1:30; Result=squeeze(sum(reshape(x,3,1,[]))) % without transpose

7 years ago | 1

Answered
Help with Matrix block multiplication
A = [1 1 0;1 1 0; 1 1 1]; B = [1,2,3;4,5,6;7,8,9;2,6,8;4,1,6;1,12,16;4,2,1;4,9,6;3,8,2]; expected_result=[A*B(1:3,:);A*B(4:6,:...

7 years ago | 2

| accepted

Answered
Index exceeds the number of array elements
Another way: x=(1:30).'; [m,n]=size(x); N=3; C=mat2cell(x,repmat(N,1,m/N)); Result=cellfun(@sum,C) Gives: Result = ...

7 years ago | 2

Answered
Index exceeds the number of array elements
One way: x=(1:30).'; [m,n]=size(x); N=3; Result=zeros(m/N,n); % preallocate for k = 1:m/N Result(k,n)=sum(x(k*N-(N-1):k...

7 years ago | 4

| accepted

Answered
Error by starting Matlab
It's better to contact mathworks support team by clicking the Contact Us button on the top right corner of this page.

7 years ago | 0

| accepted

Answered
Solve a numerical equation
x0 = 1;

7 years ago | 0

Answered
Matching index in 3rd column based on 1st and 2nd column
The one you posted is not even a valid table: T=table; T.Group = ['A' 'A' 'A' 'A' ...

7 years ago | 1

Answered
its giving an error : Undefined function 'Length' for input arguments of type 'double'.
for i=1:length(d); % ^------- should be lowercase Note: Preallocate your variables . Gives:

7 years ago | 0

Answered
what this error mean
When you are using version prior to 2016b a function definition cannot be included in a script (reason of your error) , therefor...

7 years ago | 0

Answered
using for loop to solve a function
I know it is your homwork and appreciate that you have tried something. I suggest you to do Matlab Onramp course which is inter...

7 years ago | 0

Answered
Undefined function or variable 'extractBetween'.
https://www.mathworks.com/help/matlab/ref/extractbetween.html#bvdtgvu-1_seealso - introduced in 2016b

7 years ago | 1

| accepted

Answered
if function error, here i want MatLab to find the values of V5L that are between 1 and 4.5 and name it V, and use it in another upcoming equation
EDITED clear all Q=3.3; D5L=[12.75*0.0254 14*0.0254 16*0.0254 18*0.0254 20*0.0254 22*0.0254 24*0.0254 26*0.0254 28*0.0254 30*...

7 years ago | 0

Answered
Finding the first and the second repetetion of a value in a matrix
x=[1 1 2 3 2 4 3 4 1 1 4 3 2]; X=unique(x); n=numel(X); N=2; % first...

7 years ago | 1

| accepted

Load more